-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlowLayoutExample.java
More file actions
47 lines (37 loc) · 867 Bytes
/
FlowLayoutExample.java
File metadata and controls
47 lines (37 loc) · 867 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
44
45
46
47
import java.awt.*;
import javax.swing.*;
public class FlowLayoutExample
{
JFrame frameObj;
FlowLayoutExample()
{
frameObj = new JFrame();
JButton b1 = new JButton("1");
JButton b2 = new JButton("2");
JButton b3 = new JButton("3");
JButton b4 = new JButton("4");
JButton b5 = new JButton("5");
JButton b6 = new JButton("6");
JButton b7 = new JButton("7");
JButton b8 = new JButton("8");
JButton b9 = new JButton("9");
JButton b10 = new JButton("10");
frameObj.add(b1);
frameObj.add(b2);
frameObj.add(b3);
frameObj.add(b4);
frameObj.add(b5);
frameObj.add(b6);
frameObj.add(b7);
frameObj.add(b8);
frameObj.add(b9);
frameObj.add(b10);
frameObj.setLayout(new FlowLayout());
frameObj.setSize(300, 300);
frameObj.setVisible(true);
}
public static void main(String argvs[])
{
new FlowLayoutExample();
}
}