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

JPopupMenu.setVisible(true) throws NullPointerException in headless mode

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.4.0
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      beta2
    • CPU:
      x86, sparc
    • OS:
      linux, solaris_7, solaris_8
    • Verification:
      Verified

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: