-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJBorderLayout.java
More file actions
30 lines (27 loc) · 874 Bytes
/
Copy pathJBorderLayout.java
File metadata and controls
30 lines (27 loc) · 874 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 javax.swing.*;
import java.awt.*;
public class JBorderLayout extends JFrame
{
private JButton nb = new JButton("North Button");
private JButton sb = new JButton("South Button");
private JButton eb = new JButton("East Button");
private JButton wb = new JButton("West Button");
// private JButton cb = new JButton("Center Button");
//private Container con = getContentPane();
public JBorderLayout()
{
setLayout(new BorderLayout());
add(nb, BorderLayout.NORTH);
add(sb, BorderLayout.SOUTH);
add(eb, BorderLayout.EAST);
add(wb, BorderLayout.WEST);
// add(cb, BorderLayout.CENTER);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args)
{
JBorderLayout jbl = new JBorderLayout();
jbl.setSize(250,250);
jbl.setVisible(true);
}
}