<Swing Dev> [10][JDK-8178430] JMenu in GridBagLayout flickets when label text shows "..." and is updated

Krishna Addepalli krishna.addepalli at oracle.com
Tue Oct 31 12:00:34 UTC 2017


Hi Sergey,

Thanks for pointing that out. Fixed the test case and created a new webrev here: http://cr.openjdk.java.net/~kaddepalli/8178430/webrev01/

Now, the testcase throws an exception and also after a few trials, closes on its own.

Thanks,
Krishna

-----Original Message-----
From: Sergey Bylokhov 
Sent: Tuesday, October 31, 2017 1:13 AM
To: Krishna Addepalli <krishna.addepalli at oracle.com>; swing-dev at openjdk.java.net
Subject: Re: <Swing Dev> [10][JDK-8178430] JMenu in GridBagLayout flickets when label text shows "..." and is updated

Hi, Krishna.
Can you please clarify in what situation the test will stop working(it does not have any assertions)?

On 27/10/2017 02:45, Krishna Addepalli wrote:
> Hi All,
> 
> Please review the fix for bug:
> 
> 
> Bug: JDK-8178430: https://bugs.openjdk.java.net/browse/JDK-8178430
> 
> Webrev: http://cr.openjdk.java.net/~kaddepalli/8178430/webrev00/
> 
> Summary:
> 
> The issue is when the label text width is more than the
> container(JPanel) width, the container tries to render with minimum 
> width for all the components. In such case, the JMenuItem, which is 
> added to the JMenuBar also returns its height dimension as 1 (the 
> default minimum). The test case alternates between the short text and 
> long text on the label, and it gives a flickering effect of the Menu.
> The fix is to return preferred size from JMenuItem, if its parent is a 
> JMenuBar, since JMenuBar is added to the top level window.
> 
> Thanks,
> 
> Krishna
> 


--
Best regards, Sergey.



More information about the swing-dev mailing list