Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6778810

getTableCellRendererComponent crashes with Windows L&F on Vista

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 6u10
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              alexp Alexander Potochkin (Inactive)
              Reporter:
              ppantele Petr Panteleyev (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: