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

JPopupMenu.setVisible(true) throws NullPointerException in headless mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • client-libs
    • beta2
    • x86, sparc
    • linux, solaris_7, solaris_8
    • Verified

      With this code javax.swing.JPopupMenu lw = new javax.swing.JPopupMenu();
      lw.setVisible(true);

      I get the following:

        !! FAIL: javax.swing.JPopupMenu: do_setVisible_2 status=fail with exception=java.lang.NullPointerException
      java.lang.NullPointerException
              at javax.swing.JPopupMenu.getPopup(JPopupMenu.java:733)
              at javax.swing.JPopupMenu.setVisible(JPopupMenu.java:683)
              at javax_swing_JPopupMenu.do_setVisible_2(javax_swing_JPopupMenu.java:78)
              at javax_swing_JPopupMenu.run(javax_swing_JPopupMenu.java:3510)
              at java.lang.Thread.run(Thread.java:579)

      Nowhere is Component.setVisible nor JPopupMenu.setVisible documented
      to throw any exceptions.

      Solaris 8 (sparc), JDK 1.4 build 46

      --- begin - test.java-----

      import javax.swing.JPopupMenu;

      public class test {
      public static void main(String[] args) {
      JPopupMenu menu = new JPopupMenu();
      menu.setVisible(true);
      }
      }
      --- end - test.java ----

      Execute in headless mode:

      % java -Djava.awt.headless=true test
      mark.davidson@Eng 2001-01-19

            peterz Peter Zhelezniakov
            dherronsunw David Herron (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: