<Swing Dev> RFR: 4916923: In MetalRootPaneUI, MetalRootLayout does not correctly calculate minimumsize

Sergey Bylokhov serb at openjdk.java.net
Thu Nov 5 04:09:57 UTC 2020


On Thu, 5 Nov 2020 03:55:33 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> You need to set decorations for the root pane:
>>         UIManager.setLookAndFeel(new MetalLookAndFeel());
>>         JFrame frame = new JFrame();
>>         frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
>>         frame.pack();
>>         System.out.println("Layout: " + frame.getRootPane().getLayout());
>> ========
>> Layout: javax.swing.plaf.metal.MetalRootPaneUI$MetalRootLayout at 69d9c55
>
> I tried with 
>  UIManager.setLookAndFeel(new MetalLookAndFeel());
> JFrame frame = new JFrame();
>                 frame.setSize(new Dimension(500, 800));
>                 frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
>                 //frame.pack();
>                 frame.setVisible(true);
>                 System.out.println("Layout: " + frame.getRootPane().getLayout());
>                 System.out.println("PreferredSize " + frame.getRootPane().getPreferredSize());
> but it seems tpWidth and tpHeight what is being changed is the width and height of MetalTitlePane which seems always comes as 23 for both no matter what frame size is set, so I guess using any variable will do but logically, it will be good to use "tpHeight" for height calculation.
> If it is believed to continue with same logical but not technical error, I will close this PR without integrating.

The bug submitter said that it is somehow affected his application. So I assume there is a way to trigger this bug in the MetalRootLayout.

-------------

PR: https://git.openjdk.java.net/jdk/pull/433


More information about the swing-dev mailing list