forked from teddyzhang1976/ThinkInJava4thSampleCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBorderLayout1.java
More file actions
19 lines (18 loc) · 609 Bytes
/
BorderLayout1.java
File metadata and controls
19 lines (18 loc) · 609 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//: gui/BorderLayout1.java
package gui; /* Added by Eclipse.py */
// Demonstrates BorderLayout.
import javax.swing.*;
import java.awt.*;
import static net.mindview.util.SwingConsole.*;
public class BorderLayout1 extends JFrame {
public BorderLayout1() {
add(BorderLayout.NORTH, new JButton("North"));
add(BorderLayout.SOUTH, new JButton("South"));
add(BorderLayout.EAST, new JButton("East"));
add(BorderLayout.WEST, new JButton("West"));
add(BorderLayout.CENTER, new JButton("Center"));
}
public static void main(String[] args) {
run(new BorderLayout1(), 300, 250);
}
} ///:~