JDK-6788147 : Closed Bug 6668281 still not fixed
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2008-12-22
  • Updated: 2011-02-16
  • Resolved: 2008-12-23
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
Java jre 1.6.0_04 to 1.6.0_11

ADDITIONAL OS VERSION INFORMATION :
Win32 Vista Business

EXTRA RELEVANT SYSTEM CONFIGURATION :

A DESCRIPTION OF THE PROBLEM :
The closed Prio 2 Bug 6668281 still not fixed. Please take a look at the comments and reopen it.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
On Windows Vista / AeroDesign ON run the TestCase



EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
to get the TableCellRendererComponent... but in no case a NPE!
ACTUAL -
NullPointerException occurs

ERROR MESSAGES/STACK TRACES THAT OCCUR :
xception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at sun.swing.table.DefaultTableCellHeaderRenderer.getColumnSortOrder(Unknown Source)
        at com.sun.java.swing.plaf.windows.WindowsTableHeaderUI$XPDefaultRenderer.paint(Unknown Source)
        at javax.swing.CellRendererPane.paintComponent(Unknown Source)
        at javax.swing.plaf.basic.BasicTableHeaderUI.paintCell(Unknown Source)
        at javax.swing.plaf.basic.BasicTableHeaderUI.paint(Unknown Source)
        at javax.swing.plaf.ComponentUI.update(Unknown Source)
        at javax.swing.JComponent.paintComponent(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JViewport.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)
        at javax.swing.JComponent.paint(Unknown Source)
        at javax.swing.JComponent.paintChildren(Unknown Source)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableCellRenderer;

public class bug6668281 {

    private static void createGui() {

        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
            e.printStackTrace();
        }
        JTableHeader header = new JTableHeader();
        TableCellRenderer headerRenderer = header.getDefaultRenderer();
        JTable table = new JTable();
//        table.setAutoCreateRowSorter(true);
        headerRenderer.getTableCellRendererComponent(table, "test", false, true, -1, 0);
        System.out.println("end...");
    }

    public static void main(String[] args) throws Exception {
        bug6668281.createGui();
    }
}

uncommenting the setAutoCreateRowSorter line does not help.
Trying to set an own RowSorter does not help either.
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
NONE... for me