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

Nimbus L&F: getBaseline() broken with Nimbus

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b26
    • CPU:
      x86
    • OS:
      windows_vista
    • Verification:
      Verified

      Description

      Originally filed as a JavaFX Script bug, this is actually a bug in Nimbus.

      Try the following to get a NPE in BasicListUI:

      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.*;

      public class BLTest {

          private static void createAndShowGUI(String[] args) {
              try {

      UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
              } catch (Exception e) {}

              JList list = new JList();
              list.getBaseline(1, 1);
          }

          public static void main(final String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                  public void run() {
                      createAndShowGUI(args);
                  }
              });
          }
      }


      Original description follows:

      Logging this for doc (added to cc list).
      -------------------
      When I run the JavaFXScriptImgSearch2 project (it's the JavaFX Script Image Search program that you did for me). I've attached a zip file that contains the source and the project code. If I try to run the project with JDK 1.6.0_10, it generates a Null Pointer exception as follows:

      C:\Program Files\Java\jdk1.6.0_10\bin>java.exe -jar C:\MyNetBeansProjects\JavaFScriptImgSearch2\dist\JavaFXScriptImgSearch2.jar

      java.lang.NullPointerException
             at javax.swing.plaf.basic.BasicListUI.getBaseline(BasicListUI.java:470)
             at javax.swing.JComponent.getBaseline(JComponent.java:2530)
             at javax.swing.plaf.basic.BasicScrollPaneUI.getBaseline(BasicScrollPaneI.java:386)
            ...
             at javafx.gui.Window.setWindowVisibility$impl(Window.fx:130)
             at javafx.gui.Frame.setWindowVisibility(Frame.fx:22)
             at javafx.gui.Window.postInit$(Window.fx:170)
             at javafx.gui.Frame.postInit$(Frame.fx:22)
             at javafx.gui.Frame.initialize$(Frame.fx:22)
             at javafxscriptimgsearch2.Main.javafx$run$(Main.fx:89)

      However, if I run it in JDK 1.6.0_05, it runs fine.

        Attachments

          Activity

            People

            Assignee:
            jasper Jasper Potts (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: