BAEL-5421
This commit is contained in:
parent
db1bf15694
commit
8991dbe2df
|
@ -7,20 +7,24 @@ import javax.swing.*;
|
|||
|
||||
public class MySampleGUIAppn extends JFrame{
|
||||
public MySampleGUIAppn() {
|
||||
setSize(300,300);
|
||||
setTitle("MySampleGUIAppn");
|
||||
Button b = new Button("Click Me!");
|
||||
b.setBounds(30,100,80,30);
|
||||
add(b);
|
||||
if (!GraphicsEnvironment.isHeadless()) {
|
||||
setSize(300,300);
|
||||
setTitle("MySampleGUIAppn");
|
||||
Button b = new Button("Click Me!");
|
||||
b.setBounds(30,100,80,30);
|
||||
add(b);
|
||||
setVisible(true);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent e) {
|
||||
dispose();
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
System.exit(0);
|
||||
}
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent e) {
|
||||
dispose();
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
MySampleGUIAppn app=new MySampleGUIAppn();
|
||||
|
|
|
@ -8,7 +8,7 @@ class MySampleGUIAppnUnitTest {
|
|||
|
||||
@Test
|
||||
void testMain() throws IOException {
|
||||
System.setProperty("java.awt.headless", "true");
|
||||
System.setProperty("java.awt.headless", "false");
|
||||
MySampleGUIAppn instance = new MySampleGUIAppn();
|
||||
String [] args = null;
|
||||
System.exit(0);
|
||||
|
|
Loading…
Reference in New Issue