[BAEL-5421] by @opokharel

[BAEL-5421] by @opokharel
This commit is contained in:
opokharel 2022-06-25 11:00:26 -06:00
parent 1ee4a09b2e
commit 1b29276c17
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package com.baeldung.jar;
import java.awt.event.*;
import java.awt.*;
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);
setVisible(true);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
}
});
}
public static void main(String[] args) {
MySampleGUIAppn app=new MySampleGUIAppn();
}
}

View File

@ -0,0 +1,14 @@
package com.baeldung.jar;
import org.junit.jupiter.api.Test;
class MySampleGUIAppnUnitTest extends MySampleGUIAppn {
@Test
void testMain() {
MySampleGUIAppn instance = new MySampleGUIAppn();
String [] args = null;
System.exit(DO_NOTHING_ON_CLOSE);
main(args);
}
}