- 
    Bug 
- 
    Resolution: Fixed
- 
     P3 P3
- 
    1.4.0
- 
        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
            
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
- duplicates
- 
                    JDK-4466190 JCK1.4: api/javax_swing/JPopupMenu/descriptions.html#set_isXXX, headless -           
- Closed
 
-         
- 
                    JDK-4408235 JPopupMenu.setVisible(true) throws HeadlessException -           
- Closed
 
-