forked from deepdalsania/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLayout_Demo.java
More file actions
45 lines (35 loc) · 1.02 KB
/
Layout_Demo.java
File metadata and controls
45 lines (35 loc) · 1.02 KB
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
package applet;
import java.applet.Applet;
import java.awt.Button;
import java.awt.Checkbox;
import java.awt.FlowLayout;
import java.awt.Label;
import java.awt.TextField;
@SuppressWarnings("serial")
public class Layout_Demo extends Applet{
@Override
public void init() {
// TODO Auto-generated method stub
FlowLayout f = new FlowLayout(FlowLayout.LEADING);
setLayout(f); // flow layout is default layout of applet
setBounds(100, 50, 50, 40);
Checkbox c = new Checkbox("MUSIC");
add(c);
FlowLayout f1 = new FlowLayout(FlowLayout.TRAILING);
setLayout(f1);
setBounds(100, 50, 50, 40);
Checkbox c1 = new Checkbox("DANCE");
add(c1);
// setLayout(new FlowLayout(FlowLayout.RIGHT));
Button b = new Button("SAVE");
add(b);
Button b1 = new Button("SUBMIT");
add(b1);
setLayout(new FlowLayout(FlowLayout.TRAILING));
Label l = new Label("Email : ");
add(l);
// setLayout(new FlowLayout(FlowLayout.TRAILING));
TextField tf = new TextField(10);
add(tf);
}
}