JDK-6595814 : Nimbus LAF: Renderers, MenuSeparators, colors rollup bug
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6,6u4,6u5,6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS:
    generic,solaris_10,windows_xp,windows_vista generic,solaris_10,windows_xp,windows_vista
  • CPU: generic,x86,sparc
  • Submitted: 2007-08-22
  • Updated: 2011-03-05
  • Resolved: 2008-02-14
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 6
6u10 b12Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
I've a JTree which has the customized cell renderer which basically renders the Swing Components as nodes. 

Following are the issues on the JTree with customized cell renderers on Nimbus LAF

1. When I run this test on GTK LAF the background of color of the nodes are similar to the JTree. When this attached test is run on the Nimbus LAF, the nodes background color are not the same of JTree's. 

2. Check out the gap beetween the node indicators of the normal node, the gap is little narrow when compared with the other JTree which doesn't have any customized cell renderers

3. Expand the last node 'Panel' you will see a JTextField and a JButton, only half of that node got displayed. On GTK this node is fully visible, looks like some problem height calculation. 

Please refer the attached images for more reference. 

Screenshot-JTreeTest_gtk.png 
Screenshot-JTreeTest_nimbus.png 
Screenshot-JTreeTest_windows.png
Since the renderers bug involved touching a lot of the codebase and since it impacted several other Nimbus bugs, it has been turned into a bug roundup. The following bugs are included:

-------------------------------------------------------------------
6628726 - Nimbus L&F: JList - Selected Item is not highlighted when disabled

1. Run the attached JListColorAndFontTest.java testcase,
2. Switch the Look and Feel to Nimbus, by selecting it from the Look and Feel menu.
3. Select an item from the list
4. Click on the Disable List button
5. Watch the selected item. It is not highlighted anymore, and selection highlight comes back when enabled.

For comparision, 

Switch the look and feel to Windows or Metal and repeat the steps from 3 to 5.  

There are applications/scenarios where the original selection should stay visible even when the list becomes disabled.


-------------------------------------------------------------------
6594224 - Nimbus L&F: Outline border is missing in TitleBorder.

If you apply a title border to a swing component then you can see only the title and the border around the component is missing.

I have created two title border with the names(TableFilterCriteria and SecondarySort) but i have seen only the titles after launching the application.

Please find the attached titleborder.gif image for reference.

Also Nimbus LAF : Wrong title font color on TitleBorder

This is another related bug that is fixed are both fixed in this bug.


-------------------------------------------------------------------
6605130 - Nimbus L&F: JTable sort arrow button must be right justified

JTable sort arrow button must be right justified.  Right now, it is trailing after the header label. See the attached JTable.JPG.


-------------------------------------------------------------------
6624068 - Nimbus L&F: PIT Issue: Black color appearing as white in a ComboBox inside a JTable.

This is observed in the 6u10 b07 pit build on all OS with Nimbus L&F. 
Black color appearing as white in a ComboBox inside a JTable.
Run SwingSet2 and tab to the Table demo. Drop down the Combobox in the "Favourite Color" Column and select Black. 
Expected Behavior: The Cell is rendered in Black color.
Actual Behavior: The Cell is rendered in White color.
Attached combobox_In_JTable.PNG for reference.


-------------------------------------------------------------------
6594818 - Nimbus LAF : The alternate row color is completly covers column in JFileChooser

Step to reproduce :- 
------------------
1) Run SwingSet2.
2) Select JFileChooser demo.
3) Click on 'Show Plain JFileChooser' button.
4) Click on 'Detail view' Button.
5) Observe that 'Name' column back ground is not complete touching the column separator. Actually it should be like native ( Solaris developer express ). This can be consider as a bug or an RFE . The reason for RFE is that it gives a good Look .
I have attached a screen shot of both the native & nimbus lookAndFeel (AlternateColorJFileChooser.PNG and NativeFileDialog.PNG)


-------------------------------------------------------------------
6640341 - Nimbus L&F: DefaultTreeCellRenderer issues with JTrees

When using a DefaultTreeCellRenderer with a JTree under Nimbus, the background of the TreeCell doesn't match the tree. Consider using a UI Delegate approach like the one used for JTables. We use a lot of DefaultTreeCellRenderers with our trees, pretty much simply to provide more control over the icons.

(From reading the forums, it seems clear that the issue is that DefaultTreeCellRenderer doesn't delegate most of its painting stuff to the LAF, resulting in a mismatched appearance. I worked around it by pulling the appropriate colors from the LAF and manually setting the colors in the cell renderer, but this still doesn't look great because the cell renderer isn't really painting using the LAF painter; the JTree selection is rendered with a sort of gradient along the edges but the cell renderer winds up being a flat opaque box.)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Use Nimbus.
2. Create a JTree with anything in it.
3. Set the tree cell renderer to an instance of DefaultTreeCellRenderer (or a derived class.)
4. Enjoy.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I was hoping I wouldn't have to do the following:

(1) Extract the UIDefaults to a CSV file, import into Excel, find the Nimbus keys for TreeCellRenderer colors, manually set those colors in my cell renderer based on selection and focus status, plus
(2) Add a focus listener to my trees to ensure that they repaint whenever focus is lost or gained, because otherwise the selection within the tree doesn't get repainted as fast as the tree cell, and you wind up with mismatched colors for your tree selection. (This might be a Nimbus/JTree issue in general, not just with DefaultTreeCellRenderer.)
ACTUAL -
The JTree failed to look mindblowingly awesome.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Do the following:

(1) Extract the UIDefaults to a CSV file, import into Excel, find the Nimbus keys for TreeCellRenderer colors, manually set those colors in your cell renderers based on selection and focus status.

(2) Add a focus listener to trees to ensure that they repaint whenever focus is lost, because otherwise the selection within the tree doesn't get repainted as fast as the tree cell. (This might be a Nimbus/JTree issue in general, not just with DefaultTreeCellRenderer.)

Comments
EVALUATION Fixed all issues in this bug, including the panel. Simply needed to set the default row size to 0 like Metal does.
04-02-2008

EVALUATION The problem with the "BLACK" color not working in JTable was due to the fact that Nimbus uses a subclass of Color, and Color.equals() didn't work properly with subclasses. Color was fixed such that the .equals method works properly with subclasses, and that fixed it.
04-02-2008

EVALUATION The problem with renderers has been fixed by modifying the three core default renderers, DefaultTreeCellRenderer, DefaultTableCellRenderer, and DefaultListCellRenderer. In Java 7 we hope to break this functionality out into UIDelegates and simplify the Default renderers. The bug with the last JPanel showing up wrong is still under investigation. This bug is being expanded to include a number of Nimbus LAF issues. It is not known at this time if the last fix will go into this bug, or if it will be spun out into a separate bug. Jasper is looking into that.
04-02-2008

EVALUATION Synth skining of renderers is done by subclassing the default renderers. If users create custom renderers by creating there own subclasses of default renderers then all Synth skining will be lost. The best we can do is make the default renders look correct in Nimbus without Synth skining.
30-01-2008