-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBorderlayout.java
More file actions
43 lines (35 loc) · 946 Bytes
/
Borderlayout.java
File metadata and controls
43 lines (35 loc) · 946 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
31
32
33
34
35
36
37
38
39
40
41
42
43
import java.awt.*;
import java.awt.event.*;
class myframe extends Frame
{
Button b1,b2,b3,b4,b5;
public myframe()
{
super("Border Layout");
b1=new Button("one");
b2=new Button("two");
b3=new Button("three");
b4=new Button("four");
b5=new Button("five");
add(b1,BorderLayout.EAST);
add(b2,BorderLayout.WEST);
add(b3,BorderLayout.NORTH);
add(b4,BorderLayout.SOUTH);
add(b5,BorderLayout.CENTER);
Panel p =new Panel();
p.setLayout(new GridLayout(3,1));
p.add(new Button("mon"));
p.add(new Button("tue"));
p.add(new Button("wed"));
add(p,BorderLayout.EAST);
}
}
public class Borderlayout
{
public static void main(String arg [])
{
myframe f=new myframe();
f.setSize(400,400);
f.setVisible(true);
}
}