first commit
This commit is contained in:
28
CS1322/t5/MyGUI.java
Normal file
28
CS1322/t5/MyGUI.java
Normal file
@@ -0,0 +1,28 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.*;
|
||||
|
||||
public class MyGUI extends JFrame{
|
||||
|
||||
public MyGUI(){
|
||||
super("My GUI");
|
||||
this.setLayout(new BorderLayout());
|
||||
this.getContentPane().add(new JLabel("1"),BorderLayout.EAST);
|
||||
this.getContentPane().add(new JButton("Button"),BorderLayout.NORTH);
|
||||
this.getContentPane().add(new JLabel("2"),BorderLayout.WEST);
|
||||
this.getContentPane().add(new JButton("Button2"),BorderLayout.SOUTH);
|
||||
|
||||
this.setJMenuBar(null);
|
||||
|
||||
//init window properties
|
||||
setSize(60,50);
|
||||
setResizable(false);
|
||||
setDefaultCloseOperation(EXIT_ON_CLOSE);
|
||||
|
||||
//Display the Window
|
||||
this.show();
|
||||
}
|
||||
public static void main(){
|
||||
MyGUI g = new MyGUI();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user