📄 changmima.java
字号:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
public class Changmima extends JFrame{
Label a2,a1,a3;
TextField txt1,txt2;
Button b1,b2,b3;
Frame d;
String j,k;
public Changmima (){
this.setSize(400,300);
d=new Frame();
d.setTitle("修改密码失败");
d.setSize(300,300);
b3=new Button("确定");
a3=new Label("你前后输入的密码不相同!");
d.setLayout(new FlowLayout());
d.add(a3);
b3.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
d.dispose();}});
d.add(b3);
setTitle ("修改密码界面");
setLayout(null);
a1=new Label("请输入你的新密码:");
a1.setBounds(new Rectangle(108,2,98,37));
add(a1);
txt1=new TextField(8);
txt1.setBounds(new Rectangle(108,39,180,30));
add(txt1);
a2=new Label("请再次输入你的新密码:");
a2.setBounds(new Rectangle(108,76,180,37));
add(a2);
txt2=new TextField(8);
txt2.setBounds(new Rectangle(108,113,180,30));
add(txt2);
j=new String();
k=new String();
b1=new Button("确定");
b1.setBounds(new Rectangle(78,220,86,30));
b1.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
j=txt1.getText();
k=txt2.getText();
if(j.compareTo(k)==0){
txt1.setText("");
txt2.setText("");
dispose();}
else {txt1.setText("");
txt2.setText("");d.show();}
}});
add(b1);
b2=new Button("取消");
b2.setBounds(new Rectangle(193,220,86,30));
b2.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
txt1.setText("");txt2.setText("");}});
add(b2);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -