[BAEL-5421] by @opokharel
[BAEL-5421] by @opokharel
This commit is contained in:
parent
1ee4a09b2e
commit
1b29276c17
@ -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();
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user