RFR: 8279614: The left line of the TitledBorder is not painted on 150 scale factor [v19]
Alexey Ivanov
aivanov at openjdk.java.net
Mon May 30 15:51:16 UTC 2022
On Wed, 25 May 2022 21:37:07 GMT, Alisen Chung <achung at openjdk.org> wrote:
>> Changed the drawing area to be increased by 0.5 on the left side to prevent clipping
>
> Alisen Chung has updated the pull request incrementally with one additional commit since the last revision:
>
> changed test to headless
Changes requested by aivanov (Reviewer).
test/jdk/javax/swing/border/EtchedBorder/ScaledEtchedBorderTest.java line 56:
> 54: public static JFrame frame;
> 55: public static JPanel contentPanel;
> 56: public static JPanel childPanel;
None of these fields — frame, contentPanel, childPanel — are used outside of `createGUI` method. I propose to declare them as local variables where they're used.
At this time, `frame` is used outside of `createGUI` but it shouldn't.
test/jdk/javax/swing/border/EtchedBorder/ScaledEtchedBorderTest.java line 74:
> 72: if (frame != null) {
> 73: SwingUtilities.invokeAndWait(() -> frame.dispose());
> 74: }
It doesn't make sense to dispose of the frame automatically: it's supposed to stay visible if `-show` is passed so that the user could interact with it.
test/jdk/javax/swing/border/EtchedBorder/ScaledEtchedBorderTest.java line 201:
> 199: }
> 200:
> 201: contentPanel.setSize(childSize.width, childSize.height * 4);
`contentPanel.setSize` is to be called after the for-loop when all child panels are added.
test/jdk/javax/swing/border/EtchedBorder/ScaledEtchedBorderTest.java line 228:
> 226: frame.getContentPane().add(contentPanel, BorderLayout.CENTER);
> 227: frame.pack();
> 228: frame.setLocationRelativeTo(null);frame.setVisible(true);
Please move `setVisible` to its own line.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7449
More information about the client-libs-dev
mailing list