JDK-6939001 : Nimbus: JTabbedPane setBackgroundAt and setForegroundAt have no effect
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10,6u23,7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_10,windows_vista
  • CPU: generic,x86,sparc
  • Submitted: 2010-03-29
  • Updated: 2017-05-16
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b121Fixed
Description
Tests api/javax_swing/interactive/JTabbedPaneTests.html#JTabbedPane[JTabbedPaneTest0007]  and api/javax_swing/interactive/JTabbedPaneTests.html#JTabbedPane[JTabbedPaneTest0008] fail with Nimbus LaF. Tests check  setBackgroundAt and setForegroundAt methods of the class JTabbedPane . Without Nimbus LaF test changes font and background of tabs. With Nimbus it has no effect.

steps to reproduce:

change path to JCK 6b and  run

set CLASSPATH=C:\\JCK\\JCK-runtime-6b\\classes;C:\\jcktest\\JCK-runtime-6b\\lib\\javatest
C:\\JDK\\jdk1.6.0_10\\bin\\java.exe -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel -Djava.security.policy=C:\\JCK\\JCK-runtime-6b\\lib\\jck.policy javasoft.sqe.tests.api.javax.swing.interactive.JTabbedPane.JTabbedPaneTests -TestCaseID JTabbedPaneTest0007 -TestDirURL file:/C:/jcktest/JCK-runtime-6b/tests/api/javax_swing/interactive/JTabbedPaneTests.html#JTabbedPane

Comments
EVALUATION There is note in the spec for JComponent.setBackground/setForeground methods: * It is up to the look and feel to honor this property, some may * choose to ignore it. We need to add the same note for the JTabbedPane.setBackgroundAt/setForegroundAt We can't update the spec in update releases, will fix it for JDK7
07-04-2010