【Java开源代码栏目提醒】:本文主要为网学会员提供delreader.java,希望对需要delreader.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 delreader extends JFrame {
JPanel contentPane;
XYLayout xYLayout1 = new XYLayout();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JPasswordField password = new JPasswordField();
JLabel jLabel3 = new JLabel();
JTextField name = new JTextField();
JScrollPane jScrollPane1 = new JScrollPane();
JButton jButton1 = new JButton();
JTextArea showmessage = new JTextArea();
//Construct the frame
public delreader() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
contentPane = (JPanel) this.getContentPane();
jLabel1.setFont(new java.awt.Font("SansSerif", 0, 20));
jLabel1.setForeground(Color.red);
jLabel1.setText("图书管理系统");
contentPane.setLayout(xYLayout1);
this.setSize(new Dimension(430, 325));
this.setTitle("Frame Title");
jLabel2.setFont(new java.awt.Font("SansSerif", 0, 15));
jLabel2.setText("密码");
jLabel3.setFont(new java.awt.Font("SansSerif", 0, 15));
jLabel3.setText("");
name.addActionListener(new delreader_name_actionAdapter(this));
name.setText("");
password.setText("");
jButton1.setFont(new java.awt.Font("SansSerif", 0, 15));
jButton1.setText("登录");
jButton1.addActionListener(new delreader_jButton1_actionAdapter(this));
showmessage.setText("jTextArea1");
contentPane.add(jLabel1, new XYConstraints(144, 0, 129, 36));
contentPane.add(jLabel3, new XYConstraints(79, 100, -1, 26));
contentPane.add(name, new XYConstraints(107, 97, 96, 29));
contentPane.add(password, new XYConstraints(108, 136, 94, 28));
contentPane.add(jLabel2, new XYConstraints(80, 133, -1, 28));
contentPane.add(jScrollPane1, new XYConstraints(51, 206, 294, 98));
jScrollPane1.getViewport().add(showmessage, null);
contentPane.add(jButton1, new XYConstraints(107, 164, 95, -1));
}
//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 name_actionPerformed(ActionEvent e) {
}
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");
try {
delreader1 Frame= new delreader1();
Frame.show();
}
catch (Exception ew) {
System.out.println(ew.getMessage());
}
}
else{
String outputarea = "你无权更改系统";
showmessage.setText(outputarea);
}
}
}
class delreader_name_actionAdapter implements java.awt.event.ActionListener {
delreader adaptee;
delreader_name_actionAdapter(delreader adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.name_actionPerformed(e);
}
}
class delreader_jButton1_actionAdapter implements java.awt.event.ActionListener {
delreader adaptee;
delreader_jButton1_actionAdapter(delreader adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
上一篇:
DelProductServlet.java
下一篇:
餐饮管理系统