📄 displaypropertycardlayout.java
字号:
package gui;
import java.awt.*;
/**
* 在这里插入类型说明。
* 建立日期:(00-8-10 19:44:00)
* @程序设计者:
*/
public class DisplayPropertyCardLayout extends Frame {
public Checkbox checkbox1,checkbox2,checkbox3,checkbox4;
public Panel panel1,panel2;
public Panel card1,card2,card3,card4;
public CardLayout cardlayout1;
/**
* DisplayPropertyCardLayout 构造子注释。
*/
public DisplayPropertyCardLayout() {
super();
}
/**
* DisplayPropertyCardLayout 构造子注释。
* @param title java.lang.String
*/
public DisplayPropertyCardLayout(String title) {
super(title);
setFont(new Font("Helvetica",Font.PLAIN,14));
setBackground(Color.lightGray);
setForeground(Color.black);
setLayout(new BorderLayout(0,10));
CheckboxGroup checkboxgroup1=new CheckboxGroup();
checkbox1=new Checkbox("Background",checkboxgroup1,true);
checkbox2=new Checkbox("Appearance",checkboxgroup1,false);
checkbox3=new Checkbox("Result",checkboxgroup1,false);
checkbox4=new Checkbox("Setup",checkboxgroup1,false);
panel1=new Panel();
panel1.add(checkbox1);
panel1.add(checkbox2);
panel1.add(checkbox3);
panel1.add(checkbox4);
panel2=new Panel();
cardlayout1=new CardLayout(60,20);
panel2.setLayout(cardlayout1);
//
card1=new Panel();
card1.setLayout(new BorderLayout());
card1.add(new Label("select HTML document or picture",Label.CENTER),"North");
List card1_list=new List();
card1_list.addItem("Blufkjhlk");
card1_list.addItem("Jlfvufkjk");
card1_list.addItem("Whufkgvbk");
card1_list.addItem("Rlugfvflk");
card1_list.addItem("Mlufkfgvlk");
card1_list.addItem("Llg ucjhlk");
card1_list.addItem("Flutrfkjlk");
card1_list.addItem("Plfufkjhlk");
card1.add(card1_list,"Center");
//
card2=new Panel();
card2.setLayout(new GridLayout(6,1));
card2.add(new Label("windows scheme",Label.CENTER));
card2.add(new TextField(5));
card2.add(new Label("appearance project",Label.CENTER));
card2.add(new TextField(5));
card2.add(new Label("windows font",Label.CENTER));
card2.add(new TextField(5));
//
card3=new Panel();
card3.setLayout(new GridLayout(5,1,0,5));
card3.add(new Checkbox("use big icon"));
card3.add(new Checkbox("use multi color"));
card3.add(new Checkbox("motion image display"));
card3.add(new Checkbox("drag window display"));
card3.add(new Checkbox("full screen display"));
//
card4=new Panel();
card4.setLayout(new GridLayout(3,1,0,5));
card4.add(new Button("startup password setup "));
card4.add(new Button("screen protection program"));
card4.add(new Button("saving energy characterictic"));
//
panel2.add(card1,"One");
panel2.add(card2,"Two");
panel2.add(card3,"Three");
panel2.add(card4,"Four");
//
add(panel1,"North");
add(panel2,"Center");
pack();
show();
}
/**
* 在这里插入方法说明。
* 建立日期:(00-8-9 11:44:00)
* @return boolean
* @param evt java.awt.Event
*/
public boolean handleEvent(Event evt) {
if (evt.id==Event.WINDOW_DESTROY){
dispose();
return true ;
}
if (evt.target==checkbox1){
cardlayout1.show(panel2,"One");
return true ;
}
if (evt.target==checkbox2){
cardlayout1.show(panel2,"Two");
return true ;
}
if (evt.target==checkbox3){
cardlayout1.show(panel2,"Three");
return true ;
}
if (evt.target==checkbox4){
cardlayout1.show(panel2,"Four");
return true ;
}
return super.handleEvent(evt);
}
/**
* 启动该应用程序。
* @param args 命令行参数数组
*/
public static void main(java.lang.String[] args) {
new DisplayPropertyCardLayout("Display Property Setup");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -