📄 example9_2.java
字号:
/*
method: main
params:
1. String[] args
return type: void
create time: 2004-09-04 21:18:32
author: litertiger
*/
import java.lang.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
class NameInformation
{
private String name,infor ;
public NameInformation(String n,String i)
{
name=n;
infor=i;
}
public String getName()
{
return name;
}
public String getInfor()
{
return infor;
}
}
class Example9_2 extends WindowAdapter implements ActionListener,ItemListener
{
Frame f;
Button bClose;
Label lInformation,lSelectName;
Label LSpace1=new Label();
Label LSpace2=new Label();
Label LSpace3=new Label();
Label LSpace4=new Label();
TextArea tTarget;
NameInformation [] classNameInfor=new NameInformation[4];
Choice cName;
/*
method: main
params:
1. String[] args
return type: void
create time: 2004-09-04 21:18:32
author: litertiger
*/
public static void main(String[] args)
{ Example9_2 be=new Example9_2();
be.classNameInfor[0]=new NameInformation("Tom" , "Tom is a good boy");
be.classNameInfor[1]=new NameInformation("jack","jack is the best stude of the class.")
be.classNameInfor[2]=new NameInformation("marry","Mary is a nice girl");
be.classNameInfor[3]=new NameInformation("Linda","Linda is the teacher of the class");
be.go();
}
public go(){
f=new Frame("My Frame");
f.setLayout(new GridLayout(1,2));
f.setSize(300,300);
lInformation=new Label("Information");
lSelectName=new Label("Select Name");
Panel pan1=new Panel();
Panel pan2=new Panel();
pan1.setLayout(new FlowLayout(FlowLayout.LEFT));
GridBagLayout pan2Layout=new GridBagLayout();
pan2.setLayout(pan2Layout);
GridBagConstraints c=new GridBagConstraints();
c.anchor
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -