📄 yonghgl.java
字号:
package soft1;
import java.awt.*;
import soft1Method.*;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Rectangle;
import javax.swing.BorderFactory;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import soft1Method.*;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Yonghgl extends JPanel {
MiddleLoc ml=new MiddleLoc();
GetValue gv=new GetValue() ;
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
public JButton jButton3 = new JButton();
BG jPanel1 = new BG();
XYLayout xYLayout1 = new XYLayout();
XYLayout xYLayout2 = new XYLayout();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
Icon img1= new ImageIcon("src/Pic/47.PNG");
Icon img2= new ImageIcon("src/Pic/48.PNG");
Icon img3= new ImageIcon("src/Pic/49.PNG");
public Yonghgl() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
class BG extends JPanel {
public void paintComponent(Graphics g) {
super.paintComponent(g);
Toolkit toolImg = this.getToolkit();
Image img = toolImg.getImage("src/Pic/Pic1.PNG");
g.drawImage(img,0,0,this.getSize().width,this.getSize().height,this);
}
}
private void jbInit() throws Exception {
this.setLayout(xYLayout1);
setSize(new Dimension(562, 391));
String src="src/Pic/4.PNG";
jButton1.setBorder(BorderFactory.createRaisedBevelBorder());
jButton1.setIcon(img2);
jButton1.addActionListener(new Yonghgl_jButton1_actionAdapter(this));
jButton2.setBorder(BorderFactory.createRaisedBevelBorder());
jButton2.setIcon(img1);
jButton2.addActionListener(new Yonghgl_jButton2_actionAdapter(this));
jButton3.setBorder(BorderFactory.createRaisedBevelBorder());
jButton3.setIcon(img3);
jButton3.addActionListener(new Yonghgl_jButton3_actionAdapter(this));
jPanel1.setLayout(xYLayout2);
jLabel1.setText("添加用户");
jLabel2.setText("修改密码");
jLabel3.setText("删除用户");
this.add(jPanel1, new XYConstraints(1, 0, 560, 390));
jPanel1.add(jButton3, new XYConstraints(343, 6, 95, 95));
jPanel1.add(jButton2, new XYConstraints(110, 6, 95, 95));
jPanel1.add(jButton1, new XYConstraints(227, 6, 95, 95));
jPanel1.add(jLabel1, new XYConstraints(130, 100, 76, 27));
jPanel1.add(jLabel2, new XYConstraints(251, 100, 76, 27));
jPanel1.add(jLabel3, new XYConstraints(367, 100, 76, 27));
}
public void jButton2_actionPerformed(ActionEvent e) {
Xinjyh xjyh=new Xinjyh();
ml.setLocation2(xjyh);
}
public void jButton1_actionPerformed(ActionEvent e) {
Changpsw cg=new Changpsw();
ml.setLocation2(cg);
}
public void jButton3_actionPerformed(ActionEvent e) {
if(gv.Getvalue().equals("mufen1816")){
DeleteUser du=new DeleteUser();
ml.setLocation2(du);}
else {
jButton3.enable(false);
}
}}
class Yonghgl_jButton3_actionAdapter implements ActionListener {
private Yonghgl adaptee;
Yonghgl_jButton3_actionAdapter(Yonghgl adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton3_actionPerformed(e);
}
}
class Yonghgl_jButton1_actionAdapter implements ActionListener {
private Yonghgl adaptee;
Yonghgl_jButton1_actionAdapter(Yonghgl adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
class Yonghgl_jButton2_actionAdapter implements ActionListener {
private Yonghgl adaptee;
Yonghgl_jButton2_actionAdapter(Yonghgl adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -