Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6698630
Votes 1
Synopsis JTable grid lines do not show on Nimbus with JDK 6 Update 10
Category java:classes_swing
Reported Against
Release Fixed 6u10(b26)
State 10-Fix Delivered, Verified, bug
Priority: 4-Low
Related Bugs
Submit Date 07-MAY-2008
Description
FULL PRODUCT VERSION :
java version "1.6.0_10-beta"
Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b23)
Java HotSpot(TM) Client VM (build 11.0-b11, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Windows XP SP2

A DESCRIPTION OF THE PROBLEM :
Using the code below, the grid lines do not show at all. I applied all the suggestions from http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6594663, but this did not work. This also doesn't work on the Linux version of JDK6 U10.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
(Compile and run the source code provided)

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Black grid lines of 1 pixel thickness between each cell in the table.
ACTUAL -
No grid lines.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class JTableTest {

    public static void main(String[] args)
    {
        try
        {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
        } catch (Exception ex) {}

        JTable table = new JTable(new Object[][] {
                                                    {"Mary", "Campione",
                                                     "Snowboarding", new Integer(5), new Boolean(false)},
                                                    {"Alison", "Huml",
                                                     "Rowing", new Integer(3), new Boolean(true)},
                                                    {"Kathy", "Walrath",
                                                     "Knitting", new Integer(2), new Boolean(false)},
                                                    {"Sharon", "Zakhour",
                                                     "Speed reading", new Integer(20), new Boolean(true)},
                                                    {"Philip", "Milne",
                                                     "Pool", new Integer(10), new Boolean(false)}
                                                 },
                                  new Object[] {"First Name",
                                                "Last Name",
                                                "Sport",
                                                "# of Years",
                                                "Vegetarian"});
        
        table.setGridColor(Color.BLACK);
        table.setIntercellSpacing(new Dimension(1, 1));
        table.setShowGrid(true);
        
        
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(table);
        frame.pack();
        frame.setVisible(true);
        
                
    }
}
---------- END SOURCE ----------
Posted Date : 2008-05-07 10:25:08.0
Work Around
N/A
Evaluation
I cannot reproduce the bug on Solaris x86, which is curious since the submitter said it failed on Windows and Linux (and Linux & Solaris should have no practical differences in this regard. Likewise, as far as Nimbus is concerned with rendering, Windows & Solaris shouldn't have any practical differences).
Posted Date : 2008-05-29 20:42:29.0

I can reproduce the bug on Windows, and I can see the source of the bug in the SynthTableUI class. Both intercell spacing and showGridLines are being replaced by SynthTableUI regardless of the settings of the user. Note that if the user moves the lines that adjust the table properties to after the "pack()" call, it will work (until such time as Synth decides to update the table, at which time those customizations will be lost). I'm now working on testing the fix.
Posted Date : 2008-05-29 23:11:58.0
Comments
  
  Include a link with my name & email   

Submitted On 08-DEC-2008
When you fix this, please don't make these grid lines black, as it would look ugly.


Submitted On 16-SEP-2009
Kleopatra
this is still not fixed completely as of:

java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)


it's now possible to set the gridlines and spacing, but they get lost in the next table.updateUI. Didn't dig, but problem might be that the synthTableUI doesn't check the intercellspacing (and/or gridColor or any dedicated marker - simple types like booleans are difficult ... ) for being a UIResource. If it isn't that would be an indication that the ui is allowed to change it. 

Jeanette



PLEASE NOTE: JDK6 is formerly known as Project Mustang