JDK-6936487 : NIMBUS: Jtable.getIntercellSpacing() returns (0,0) instead of (1,1) by default
  • 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
Related Reports
Duplicate :  
Description
spec says: 

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

getIntercellSpacing

public Dimension getIntercellSpacing()

    Returns the horizontal and vertical space between cells. The default spacing is (1, 1), which provides room to draw the grid.

    Returns:
        the horizontal and vertical spacing between cells
    See Also:
        setIntercellSpacing(java.awt.Dimension)


but instead method returns (0,0) by default.

minimal test case:

import javax.swing.*;
import javax.swing.table.*;


public class Test{


public static void main(String[] args){


        JTable c = new JTable(); // step Create JTable object
        int cl_num = c.getColumnCount();
        int r_num = c.getRowCount();
        TableColumn tc = new TableColumn();
        Object id = new Object();
        tc.setIdentifier(id);
        c.addColumn(tc);


        if (c.getIntercellSpacing().width == 1);else System.out.println("c.getIntercellSpacing().width == 1 failed; c.getIntercellSpacing().width="+c.getIntercellSpacing().width);

        if (c.getIntercellSpacing().height == 1);else System.out.println("assertion c.getIntercellSpacing().height == 1 failed; c.getIntercellSpacing().height="+c.getIntercellSpacing().height);
                
	System.out.println("Finished");

}
}


execution:

C:\tests\JTable>C:\JDK\jdk1.6.0_10\bin\java.exe -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel Test
c.getIntercellSpacing().width == 1 failed; c.getIntercellSpacing().width=0
assertion c.getIntercellSpacing().height == 1 failed; c.getIntercellSpacing().height=0
Finished

C:\tests\JTable>C:\JDK\jdk1.6.0_10\bin\java.exe  Test
Finished