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

The JViewport.setViewPosition() throws NullPointerException

XMLWordPrintable

    • sparc
    • solaris_2.5.1



      Name: aaC67449 Date: 05/21/99



      The JViewport.setViewPosition() throws unexpected NullPointerException

      javadoc says: "
      public void setViewPosition(Point p)

             Sets the view coordinates that appear in the upper left hand corner of
             the viewport, does nothing if there's no view.
             Parameters:
                    p - a Point object giving the upper left coordinates
      "
      This bug appears in JDK-1.3D
      It works correctly in JDK-1.3C.

      ---------------- example ---------------
      public class Test {
       
         public static void main(String argv[]) {
             JViewport c = new JViewport();
             c.add(new JButton());
             c.setViewPosition(new Point(1,1));
             System.out.println("PASSED");

        }
       
      }

      -------------JDK-1.3D output---------
      Exception in thread "main" java.lang.NullPointerException
              at javax.swing.JViewport.setViewPosition(JViewport.java:974)
              at Test.main(Test.java:10)

      --- ---------JDK-1.3C output -------------
      PASSED

      ======================================================================

            svioletsunw Scott Violet (Inactive)
            alisunw Ali Ali (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: