jdk-24/jdk/test/java/awt/Menu/NullMenuLabelTest/NullMenuLabelTest.java
Andrei Dmitriev 41e1560d14 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards
6808185: test/closed/java/awt/Menu/NullMenuLabelTest crashes

Reviewed-by: dcherepanov
2010-08-31 15:05:09 +04:00

27 lines
724 B
Java

/* @test 1.5 98/07/23
@bug 4064202 4253466
@summary Test for Win32 NPE when MenuItem with null label added.
@author fred.ecks
@run main/othervm NullMenuLabelTest
*/
import java.awt.*;
public class NullMenuLabelTest {
public static void main(String[] args) {
Frame frame = new Frame("Test Frame");
frame.pack();
frame.setVisible(true);
MenuBar menuBar = new MenuBar();
frame.setMenuBar(menuBar);
Menu menu = new Menu(null);
menuBar.add(menu);
menu.add(new MenuItem(null));
// If we got this far, the test succeeded
frame.setVisible(false);
frame.dispose();
}
} // class NullMenuLabelTest