-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBorderLayoutDemo.java
More file actions
26 lines (23 loc) · 887 Bytes
/
Copy pathBorderLayoutDemo.java
File metadata and controls
26 lines (23 loc) · 887 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
import java.awt.*;
import java.awt.event.*;
public class BorderLayoutDemo extends Frame{
public BorderLayoutDemo(){
add(new Button("This is accross the top "),BorderLayout.NORTH);
add(new Label("The footer message "),BorderLayout.NORTH);
add(new Button("Right"),BorderLayout.EAST);
add(new Button("Left"),BorderLayout.WEST);
String S="Time is Running Fast";
add(new TextArea(S+S+S+S),BorderLayout.CENTER);
addWindowListener(new WindowAdapter(){
public void WindowClosing(WindowEvent we){
System.exit(0);
}
});
}
public static void main(String[] args) {
BorderLayoutDemo appwin=new BorderLayoutDemo();
appwin.setSize(new Dimension(300,220));
appwin.setTitle("BorderLayoutDemo");
appwin.setVisible(true);
}
}