50c9be315e4f001d174bd50f6d5c7d09

来自「学生管理系统.对学生信息管理的一个应用软件!」· 代码 · 共 62 行

TXT
62
字号
import javax.swing.*;
import java.awt.*;
import javax.swing.border.*;
import java.awt.event.*;
class studentPassword extends JFrame implements ActionListener
{  Box baseBox,boxV1,boxV2;
   TextField psdText, newpText,passwordText;
   Label psdLabel,newpLabel,passwordLabel;
   Button sureButton;
   studentPassword(String s)
   {  super(s);
      psdLabel=new Label("旧密码",Label.LEFT);
      psdText=new TextField(10);
	  newpLabel=new Label("新密码",Label.LEFT);
	  newpText=new TextField(10);
	  passwordText=new TextField(10);
	  passwordLabel=new Label("确认新密码",Label.LEFT);
      sureButton=new Button("确定");
	  
	  boxV1=Box.createVerticalBox();
	  boxV1.add(psdLabel);
	  boxV1.add(Box.createVerticalStrut(1));
	  boxV1.add(newpLabel);
	  boxV1.add(Box.createVerticalStrut(1));
	  boxV1.add(passwordLabel);
	  
	  
	  boxV2=Box.createVerticalBox();
	  boxV2.add(psdText);
	  boxV2.add(Box.createVerticalStrut(4));
	  boxV2.add(newpText);
      boxV2.add(Box.createVerticalStrut(4));
      boxV2.add(passwordText);
      boxV2.add(Box.createVerticalStrut(10));
      boxV2.add(sureButton);
      
	  baseBox=Box.createHorizontalBox();
	  baseBox.add(boxV1);
	  baseBox.add(Box.createHorizontalStrut(1));
	  baseBox.add(boxV2);
	  setLayout(new FlowLayout());
	  add(baseBox);
	  baseBox.add(Box.createHorizontalStrut(1));
	  this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	  
      newpText.addActionListener(this);
      passwordText.addActionListener(this);
      sureButton.addActionListener(this);
	  setBounds(120,120,300,300);
	  setVisible(true);
	  validate();
   }
  
   public void actionPerformed(ActionEvent e)
   {
   }
}
public class studentPsd
{  public static void main(String args[])
   {  studentPassword Win=new studentPassword("密码修改") ;
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?