【Java开源代码栏目提醒】:网学会员为需要Java开源代码的朋友们搜集整理了addreader.java相关资料,希望对各位网友有所帮助!
package untitled5;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class addreader extends JFrame {
JPanel contentPane;
JLabel jLabel1 = new JLabel();
XYLayout xYLayout1 = new XYLayout();
JLabel jLabel2 = new JLabel();
JTextField name = new JTextField();
JLabel jLabel3 = new JLabel();
JPasswordField password = new JPasswordField();
JButton jButton1 = new JButton();
JScrollPane jScrollPane1 = new JScrollPane();
JTextField showmessage = new JTextField();
//Construct the frame
public addreader() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(xYLayout1);
this.setSize(new Dimension(400, 400));
this.setTitle("Frame Title");
jLabel1.setFont(new java.awt.Font("SansSerif", 0, 20));
jLabel1.setForeground(Color.red);
jLabel1.setRequestFocusEnabled(true);
jLabel1.setText("图书管理系统");
jLabel2.setFont(new java.awt.Font("SansSerif", 0, 15));
jLabel2.setRequestFocusEnabled(true);
jLabel2.setText("");
name.setText("");
jLabel3.setFont(new java.awt.Font("SansSerif", 0, 15));
jLabel3.setText("密码");
password.setText("");
jButton1.setFont(new java.awt.Font("SansSerif", 0, 15));
jButton1.setText("登录");
jButton1.addActionListener(new addreader_jButton1_actionAdapter(this));
contentPane.add(jLabel1, new XYConstraints(149, 6, 123, 28));
contentPane.add(jLabel2, new XYConstraints(55, 78, -1, -1));
contentPane.add(name, new XYConstraints(81, 76, 90, 29));
contentPane.add(jLabel3, new XYConstraints(53, 117, -1, 23));
contentPane.add(password, new XYConstraints(82, 114, 89, 29));
contentPane.add(jButton1, new XYConstraints(82, 145, 89, 28));
contentPane.add(jScrollPane1, new XYConstraints(31, 210, 325, 161));
jScrollPane1.getViewport().add(showmessage, null);
}
//Overridden so we can exit when window is closed
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}
void jButton1_actionPerformed(ActionEvent e) {
String str1=name.getText();
String str2=password.getText();
if((str1.equals("sysman"))&&(str2.equals("tongfang")))
{ //System.out.println("a;lkdjfklasjdfj");
this.setVisible(false);
try {
addreader1 Frame= new addreader1();
Frame.show();
}
catch (Exception ew) {
System.out.println(ew.getMessage());
}
}
else{
String outputarea="你无权更改系统";
showmessage.setText(outputarea);
}
}
}
class addreader_jButton1_actionAdapter implements java.awt.event.ActionListener {
addreader adaptee;
addreader_jButton1_actionAdapter(addreader adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
上一篇:
AddRadioFrame.java
下一篇:
2018年汽车自驾运动营地攻防箭大赛总决赛圆满落幕