📄 d0420336f84f001d1594abca140770d0
字号:
import java .awt.*;
import java.awt.event.*;
import javax.swing.border.*;
import javax.swing.Box;
import javax.swing.*;
import javax.swing.WindowConstants;
class Mypanel extends Panel implements ActionListener
{ Button sureButton,chargeButton;
Box baseBox,boxV1,boxV2,boxV3;
Label userLabel,pswLabel,repswLabel;
TextField noText,pswordText,repswText;
Mypanel()
{ sureButton=new Button("确定");
//chargeButton=new Button("修改");
userLabel=new Label("用户名",Label.LEFT);
pswLabel=new Label("密码",Label.LEFT);
repswLabel=new Label("重置密码",Label.LEFT);
noText=new TextField(10);
pswordText=new TextField(10);
repswText=new TextField(10);
boxV1=Box.createVerticalBox();
boxV1.add(userLabel);
boxV1.add(Box.createVerticalStrut(8));
boxV1.add(pswLabel);
boxV1.add(Box.createVerticalStrut(8));
boxV1.add(repswLabel);
boxV2=Box.createVerticalBox();
boxV2.add(noText);
boxV2.add(Box.createVerticalStrut(8));
boxV2.add(pswordText);
boxV2.add(Box.createVerticalStrut(8));
boxV2.add(repswText);
boxV3=Box.createVerticalBox();
boxV3.add(sureButton);
// boxV3.add(Box.createVerticalStrut(10));
// boxV3.add(chargeButton);
// boxV3.add(Box.createVerticalStrut(10));
baseBox=Box.createHorizontalBox();
baseBox.add(boxV1);
baseBox.add(Box.createHorizontalStrut(10));
baseBox.add(boxV2);
//baseBox.add(Box.createHorizontalStrut(10));
//baseBox.add(boxV3);
add(baseBox);
noText.addActionListener(this);
pswordText.addActionListener(this);
repswText.addActionListener(this);
sureButton.addActionListener(this);
chargeButton.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
}
}
class managerWindow extends JFrame implements ActionListener
{ Button addButton,resetButton,delButton;
Mypanel panel1;
managerWindow(String s)
{ super(s);
setLayout(new FlowLayout());
panel1=new Mypanel();
addButton=new Button("添加");
resetButton=new Button("修改");
delButton=new Button("删除");
add(addButton);
add(resetButton);
add(delButton);
add(panel1);
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setBounds(120,120,300,300);
setVisible(true);
validate();
}
public void actionPerformed(ActionEvent e)
{
}
}
/*public class Manager
{ public static void main(String args[])
{ managerWindow win=new managerWindow("系统管理");
}
}*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -