-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
None
-
6u10
-
x86
-
windows_vista
The following code crashes on Vista when L&F is set to
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
TableColumn column = jTable1.getColumnModel().getColumn(0);
JTableHeader header = jTable1.getTableHeader();
TableCellRenderer renderer = header.getDefaultRenderer();
Component comp = renderer.getTableCellRendererComponent(null, column.getHeaderValue(), false, false, 0, 0);
The following exception is thrown:
java.lang.NullPointerException
at sun.swing.table.DefaultTableCellHeaderRenderer.getColumnSortOrder(DefaultTableCellHeaderRenderer.java:113)
at com.sun.java.swing.plaf.windows.WindowsTableHeaderUI$XPDefaultRenderer.getTableCellRendererComponent(WindowsTableHeaderUI.java:108)
at tableuicrash.TableUICrashView.<init>(TableUICrashView.java:31)
at tableuicrash.TableUICrashApp.startup(TableUICrashApp.java:35)
...
This issue does not happen with other built-in L&Fs. For example, Metal and Nimbus work. From what I see in source code for the method in questions the issue is specific to "WindowsLookAndFeel.isOnVista()".
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
Please, see full sample in attachments.
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
TableColumn column = jTable1.getColumnModel().getColumn(0);
JTableHeader header = jTable1.getTableHeader();
TableCellRenderer renderer = header.getDefaultRenderer();
Component comp = renderer.getTableCellRendererComponent(null, column.getHeaderValue(), false, false, 0, 0);
The following exception is thrown:
java.lang.NullPointerException
at sun.swing.table.DefaultTableCellHeaderRenderer.getColumnSortOrder(DefaultTableCellHeaderRenderer.java:113)
at com.sun.java.swing.plaf.windows.WindowsTableHeaderUI$XPDefaultRenderer.getTableCellRendererComponent(WindowsTableHeaderUI.java:108)
at tableuicrash.TableUICrashView.<init>(TableUICrashView.java:31)
at tableuicrash.TableUICrashApp.startup(TableUICrashApp.java:35)
...
This issue does not happen with other built-in L&Fs. For example, Metal and Nimbus work. From what I see in source code for the method in questions the issue is specific to "WindowsLookAndFeel.isOnVista()".
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
Please, see full sample in attachments.