Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6595814

Nimbus LAF: Renderers, MenuSeparators, colors rollup bug

    Details

    • Subcomponent:
    • Resolved In Build:
      b12
    • CPU:
      generic, x86, sparc
    • OS:
      generic, solaris_10, windows_xp, windows_vista
    • Verification:
      Verified

      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.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rbair Richard Bair
                Reporter:
                esubramasunw Elancheran Subramanian (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: