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

NPE thrown with JScrollPane.getPreferredSize

XMLWordPrintable

      This is reproducible on all platforms with jdk7 b26 awt pit build. Not reproducible with 6u10 b23.

      Run the below test. It throws a NPE.
      Exception in thread "main" java.lang.NullPointerException
              at javax.swing.ScrollPaneLayout.preferredLayoutSize(ScrollPaneLayout.java:494)
              at java.awt.Container.preferredSize(Container.java:1661)
              at java.awt.Container.getPreferredSize(Container.java:1646)
              at javax.swing.JComponent.getPreferredSize(JComponent.java:1645)
              at TestSP.main(TestSP.java:6)


      import javax.swing.*;

      public class TestSP {
          public static void main(String[] args) {
              JScrollPane sp = new JScrollPane();
              sp.getPreferredSize();
          }
      }

            alexp Alexander Potochkin (Inactive)
            gramachasunw Girish Ramachandran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: