-
Notifications
You must be signed in to change notification settings - Fork 0
/
LastDemo.java
62 lines (43 loc) · 1.33 KB
/
LastDemo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class LastDemo extends JFrame {
public LastDemo() {
setTitle("Last Demo for July 2");
setSize(600, 600);
setLayout(new BorderLayout());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel cPanel = new JPanel();
JPanel nPanel = new JPanel();
JPanel sPanel = new JPanel();
JPanel ePanel = new JPanel();
JPanel wPanel = new JPanel();
JButton centerButton = new JButton("Center");
JButton northButton = new JButton("North");
JButton southButton = new JButton("South");
JButton eastButton = new JButton("East");
JButton westButton = new JButton("West");
JButton q = null;
cPanel.setLayout(new GridLayout(0,4));
cPanel.add(centerButton);
cPanel.add(northButton);
//nPanel.add(northButton);
sPanel.add(southButton);
ePanel.add(eastButton);
wPanel.add(westButton);
add(cPanel, BorderLayout.CENTER);
add(nPanel, BorderLayout.NORTH);
add(sPanel, BorderLayout.SOUTH);
add(ePanel, BorderLayout.EAST);
add(wPanel, BorderLayout.WEST);
}
public static void main(String args[]) {
LastDemo l = new LastDemo();
l.setVisible(true);
}
}