📄 009bd7d91b4f001d1dfab05036c3dc79
字号:
import java .awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.Box;
class Mypanel1 extends Panel implements ActionListener
{ Box baseBox,boxV1,boxV2;
Label nameLabel,noLabel,classLabel;
TextField nameText,noText,classText;
Button sureButton;
Mypanel1(String s)
{ nameLabel=new Label("姓名",Label.LEFT);
noLabel=new Label("学号",Label.LEFT);
classLabel=new Label("班级",Label.LEFT);
nameText=new TextField(10);
noText=new TextField(10);
classText=new TextField(10);
sureButton=new Button("确定");
boxV1=Box.createVerticalBox();
boxV1.add(nameLabel);
boxV1.add(Box.createVerticalStrut(18));
boxV1.add(noLabel);
boxV1.add(Box.createVerticalStrut(18));
boxV1.add(classLabel);
boxV2=Box.createVerticalBox();
boxV2.add(nameText);
boxV2.add(Box.createVerticalStrut(18));
boxV2.add(noText);
boxV2.add(Box.createVerticalStrut(18));
boxV2.add(classText);
baseBox=Box.createHorizontalBox();
baseBox.add(boxV1);
baseBox.add(boxV2);
add(baseBox);
add(sureButton);
nameText.addActionListener(this);
noText.addActionListener(this);
classText.addActionListener(this);
sureButton.addActionListener(this);
setBounds(120,120,300,300);
setVisible(true);
validate();
}
public void actionPerformed(ActionEvent e)
{
}
}
public class searchMen
{ public static void main(String args[])
{ Mypanel1 win=new Mypanel1("人员信息查询");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -