<Swing Dev> RFR: 8058704: Nimbus does not honor JTextPane background color
Alexey Ivanov
aivanov at openjdk.java.net
Fri Jul 30 20:50:33 UTC 2021
On Thu, 29 Jul 2021 11:44:31 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> The Nimbus look and feel ignores the configured background color of a JTextPane and always uses white.
> Every other look and feel tested (Metal, Motif, and Windows) correctly honors the configured background color of a JTextPane.
> Issue seems to be in the hardcoded background color in nimbus skin which is rectified via the fix.
> After this fix, the background color is correctly updated to whatever is being set via JTextPane.setBackground().
>
> CI all test run is green.
You're removing the default background which was painted previously. Does it mean there's no default any more? What will paint the background if it's not set explicitly?
test/jdk/javax/swing/plaf/nimbus/TestNimbusJTextPaneColor.java line 65:
> 63: Thread.sleep(1000);
> 64: Robot robot = new Robot();
> 65: Point pt = frame.getLocationOnScreen();
`getLocationOnScreen` should be called on EDT.
test/jdk/javax/swing/plaf/nimbus/TestNimbusJTextPaneColor.java line 74:
> 72: if (frame != null) {
> 73: SwingUtilities.invokeAndWait(frame::dispose);
> 74: }
`frame` is accessed on main thread without synchronisation.
-------------
Changes requested by aivanov (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/4930
More information about the swing-dev
mailing list