blob: a90bce0043acd2fff4ab74e39f78b7dc427a79d6 (
plain)
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
|
/* Listing3109.java */
import java.awt.*;
import java.awt.event.*;
public class Listing3109
extends Frame
{
public static void main(String[] args)
{
Listing3109 wnd = new Listing3109();
wnd.setVisible(true);
}
public Listing3109()
{
super("Geschachtelte Layoutmanager, Teil II");
addWindowListener(new WindowClosingAdapter(true));
//Layout setzen und Komponenten hinzuf�gen
setSize(300,200);
//Panel 1
Panel panel1 = new Panel();
panel1.setLayout(new GridLayout(3,2));
panel1.add(new Button("Button1"));
panel1.add(new Button("Button2"));
panel1.add(new Button("Button3"));
panel1.add(new Button("Button4"));
panel1.add(new Button("Button5"));
panel1.add(new Button("Button6"));
//Panel 2
Panel panel2 = new Panel();
panel2.setLayout(new FlowLayout(FlowLayout.RIGHT));
panel2.add(new Button("Abbruch"));
panel2.add(new Button("OK"));
//Hauptfenster
setLayout(new BorderLayout());
add(panel1, BorderLayout.CENTER);
add(panel2, BorderLayout.SOUTH);
}
}
|