import java.awt.*;
import java.awt.event.*;
public class Demo04 extends Frame
{
Button button01 = new Button("aaa");
Button button02 = new Button("aaa");
Button button03 = new Button("aaa");
Button button04 = new Button("aaa");
Button button05 = new Button("aaa");
Button button06 = new Button("aaa");
Button button07 = new Button("aaa");
Button button08 = new Button("aaa");
Button button09 = new Button("aaa");
Button button10 = new Button("aaa");
Button button11 = new Button("aaa");
Button button12 = new Button("aaa");
Button button13 = new Button("aaa");
Button button14 = new Button("aaa");
Button button15 = new Button("aaa");
Button button16 = new Button("aaa");
Button button17 = new Button("aaa");
Button button18 = new Button("aaa");
Button button19 = new Button("aaa");
Button button20 = new Button("aaa");
Button button21 = new Button("aaa");
Button button22 = new Button("aaa");
Button button23 = new Button("aaa");
Button button24 = new Button("aaa");
Button button25 = new Button("aaa");
Panel p1 = new Panel();
Panel p2 = new Panel();
Panel p3 = new Panel();
Panel p4 = new Panel();
Panel p5 = new Panel();
void init()
{
p1.setLayout(new BorderLayout());
p1.add(button01,BorderLayout.NORTH);
p1.add(button02,BorderLayout.SOUTH);
p1.add(button03,BorderLayout.WEST);
p1.add(button04,BorderLayout.EAST);
p1.add(button05,BorderLayout.CENTER);
p2.add(button06);
p2.add(button07);
p2.add(button08);
p2.add(button09);
p2.add(button10);
p3.add(button11);
p3.add(button12);
p3.add(button13);
p3.add(button14);
p3.add(button15);
p4.add(button16);
p4.add(button17);
p4.add(button18);
p4.add(button19);
p4.add(button20);
p5.add(button21);
p5.add(button22);
p5.add(button23);
p5.add(button24);
p5.add(button25);
p1.setBackground(Color.orange);
p2.setBackground(Color.cyan);
p3.setBackground(Color.blue);
p4.setBackground(Color.green);
p5.setBackground(Color.PINK);
add(p1,BorderLayout.NORTH);
add(p2,BorderLayout.SOUTH);
add(p3,BorderLayout.CENTER);
add(p4,BorderLayout.WEST);
add(p5,BorderLayout.EAST);
}
Demo04()
{
setSize(500,500);
init();
show();
}
public static void main(String s[])
{
new Demo04();
}
}
网友评论