-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeadMain.java
More file actions
executable file
·30 lines (23 loc) · 823 Bytes
/
Copy pathHeadMain.java
File metadata and controls
executable file
·30 lines (23 loc) · 823 Bytes
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
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.Panel;
import javax.swing.JFrame;
public class HeadMain {
public static void main(String args[]) {
JFrame frame = new JFrame("Head");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Panel topPanel = new Panel(new GridLayout(2, 2));
Head panel1 = new Head();
Head panel2 = new Head();
Head panel3 = new Head();
Head panel4 = new Head();
topPanel.add(panel1, BorderLayout.EAST);
topPanel.add(panel2, BorderLayout.WEST);
topPanel.add(panel3, BorderLayout.NORTH);
topPanel.add(panel4, BorderLayout.SOUTH);
frame.getContentPane().add(topPanel);
frame.pack();
frame.setVisible(true);
}
}