<AWT Dev>  Review request for 7160604: Using non-opaque windows - popups are initially not painted correctly
alexandr.scherbatiy at oracle.com
Fri Nov 22 01:02:40 PST 2013
The fix looks good for me.
On 11/20/2013 6:23 PM, Oleg Pekhovskiy wrote:
> Hi Sergey,
> thanks you for the review,
> please see the next version of fix:
> getPopup() method was renamed to showPopup().
> On 20.11.2013 15:14, Sergey Bylokhov wrote:
>> Hi, Oleg.
>> Looks like now getPopup method should be renamed, because it returns
>> On 20.11.2013 15:06, Oleg Pekhovskiy wrote:
>>> Hi all,
>>> please review the fix
>>> For now popup menu is painted correctly, so the fix applies to
>>> drop-down list of combo-box only.
>>> BasicComboPopup class implements drop-down list.
>>> BasicComboPopup.isVisible() checks whether BasicComboPopup.popup field
>>> is not null. When the drop-down list is about to show and the
>>> following call-chain occurs: BasicComboPopup.togglePopup() -> show()
>>> -> setVisible(true) -> getPopup()
>>> newPopup.show() method is called before BasicComboPopup.popup field is
>>> updated. Thus when painting occurs for the first time (synchronously,
>>> inside newPopup.show()), BasicComboPopup.isVisible() returns false and
>>> JComponent.paintChildren() skips drawing of BasicComboPopup.
>>> So the fix makes BasicComboPopup.popup field being updated before call
>>> of Popup.show(). Moreover setting of BasicComboPopup.popup field was
>>> moved inside BasicComboPopup.getPopup() method as the same thing
>>> happened after each call of this method.
More information about the awt-dev