JDK-6936495 : NIMBUS: JTable.getShowHorizontalLines doesn't return default value
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2010-03-19
  • Updated: 2012-03-22
  • Resolved: 2010-03-23
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
7Resolved
Related Reports
Duplicate :  
Relates :  
Description
According to spec,

http://java.sun.com/javase/6/docs/api/javax/swing/JTable.html#getShowHorizontalLines()

getShowHorizontalLines

public boolean getShowHorizontalLines()

    Returns true if the table draws horizontal lines between cells, false if it doesn't. The default is true. 


But code:
import javax.swing.*;
import javax.swing.table.*;


public class Test2{


public static void main(String[] args){


        JTable c = new JTable();
        if (!c.getShowHorizontalLines()) {
            System.out.println("FAILED");
        }else
        System.out.println("OKAY");
                

}
}


prints false if Nimbus LaF specified

C:\tests\JTable>C:\JDK\jdk1.6.0_10\bin\java.exe  Test2
OKAY

C:\tests\JTable>C:\JDK\jdk1.6.0_10\bin\java.exe -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel Test2
FAILED

the same problem is with getShowVerticalLines()

Comments
EVALUATION We should comply with the spec
19-03-2010