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

JTable.addNotify() method throws NPE

XMLWordPrintable



      Name: nkR10003 Date: 11/17/2000


      Public JTable.addNotify() method throws
      NullPointerExcption (NPE).

      Example below demonstrates this problem:
      ------------------example--------------------
      import javax.swing.*;
      public class test {
          public static void main(String[] args) {
              JTable c = new JTable(); // step Create JTable object
              JScrollPane pane = new JScrollPane(c);
              try {
                  c.addNotify();
              } catch (Exception e) {
                  e.printStackTrace();
              }
              System.out.println("Test Finished");
              System.exit(0);
          }
      }
      ----------------output:----------------------
      java.lang.NullPointerException
              at java.awt.dnd.DropTarget.addNotify(DropTarget.java:436)
              at java.awt.Component.addNotify(Component.java:4508)
              at java.awt.Container.addNotify(Container.java:1748)
              at javax.swing.JComponent.addNotify(JComponent.java:3799)
              at javax.swing.JTable.addNotify(JTable.java:416)
              at test.main(test.java:7)
      Test Finished
      ---------------------------------------------
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: