java选课系统界面代码 选课系统javaweb( 二 )


TextField t1,t2;
Button btn;
p8()
{
p11=new Panel();
p22=new Panel();
p33=new Panel();
p44=new Panel();
p55=new Panel();
p11.setLayout(new GridLayout(1,1));
p22.setLayout(new GridLayout(1,1));
p33.setLayout(new GridLayout(1,4));
p44.setLayout(new GridLayout(1,4));
p55.setLayout(new GridLayout(1,1));
l4=new Label("");
l5=new Label("");
l6=new Label("");
l7=new Label("");
l9=new Label("");
l1=new Label("欢迎来到网上选课系统",Label.CENTER);
Font f=new Font("宋体",Font.BOLD,30);
l1.setFont(f);
l2=new Label("请输入管理员帐号",Label.CENTER);
l3=new Label("请输入管理员密码",Label.CENTER);
setBackground(Color.lightGray);
btn=new Button("确定");
t1=new TextField(20);
t2=new TextField(15);
t2.setEchoChar(′*′);
【java选课系统界面代码 选课系统javaweb】l1.setForeground(Color.magenta);
t1.setBackground(Color.cyan);
t2.setBackground(Color.cyan);
t1.setForeground(Color.red);
t2.setForeground(Color.red);
l2.setForeground(Color.blue);
l3.setForeground(Color.blue);
p11.add(l1);
p22.add(l4);
p33.add(l5);
p33.add(l2);
p33.add(t1);
p33.add(l6);
p44.add(l7);
p44.add(l3);
p44.add(t2);
p44.add(btn);
p55.add(l9);
setLayout(new GridLayout(5,1));
add(p11);
add(p22);
add(p33);
add(p44);
add(p55);
}
}
class p9 extends Panel
{
p1 pn1=new p1();
p2 pn2=new p2();
p3 pn3=new p3();
p4 pn4=new p4();
p5 pn5=new p5();
p6 pn6=new p6();
p9()
{
setLayout(new GridLayout(6,1));
add(pn1);
add(pn2);
add(pn3);
add(pn4);
add(pn5);
add(pn6);
}
}
class user
{
String username;
String sd;
String major;
String institute;
String course;
user(String x1,String x2,String x3,String x4,String x5)
{
username=x1;
sd=x2;
major=x3;
institute=x4;
course=x5;
}
}
public class www
{
public static void main(String args[])
{
new m();
}
}
class m extends Frame implements ActionListener,ItemListener
{
StringBuffer ss=new StringBuffer("您好!您选修的课程有:");
Vector xiang=new Vector();
p9 pn9;
p8 pn8;
CardLayout cc=new CardLayout();
Button btn1;
Dialog d1;
m()
{
super("网上选课");
pn8=new p8();
pn9=new p9();
setLayout(cc);
add("one",pn8);
add("two",pn9);
btn1=new Button("确定");
pn9.pn1.l1.setBackground(Color.pink);
pn9.pn1.l1.setForeground(Color.blue);
pn9.pn2.l1.setBackground(Color.gray);
pn9.pn2.l1.setForeground(Color.orange);
pn9.pn2.l2.setBackground(Color.gray);
pn9.pn2.l2.setForeground(Color.orange);
pn9.pn3.l1.setBackground(Color.gray);
pn9.pn3.l1.setForeground(Color.orange);
pn9.pn3.l2.setBackground(Color.gray);
pn9.pn3.l2.setForeground(Color.orange);
pn9.pn2.t1.setForeground(Color.red);
pn9.pn2.t1.setBackground(Color.cyan);
pn9.pn2.t2.setForeground(Color.red);
pn9.pn2.t2.setBackground(Color.cyan);
pn9.pn3.t1.setForeground(Color.red);
pn9.pn3.t1.setBackground(Color.cyan);
pn9.pn3.t2.setForeground(Color.red);
pn9.pn3.t2.setBackground(Color.cyan);
pn9.pn5.list.setBackground(Color.pink);
pn9.pn5.list.setForeground(Color.blue);
pn9.pn6.ta.setBackground(Color.blue);
pn9.pn6.ta.setForeground(Color.white);
pn9.pn4.btn1.addActionListener(this);
pn9.pn4.btn2.addActionListener(this);
pn9.pn4.btn3.addActionListener(this);
pn9.pn5.list.addActionListener(this);

推荐阅读