⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addbook1.java~3~

📁 这是Java数据库系统项目开发实践源代码,所有代码经过测试
💻 JAVA~3~
字号:
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 addbook1 extends JFrame {  JPanel contentPane;  XYLayout xYLayout1 = new XYLayout();  JLabel jLabel1 = new JLabel();  JLabel jLabel2 = new JLabel();  JTextField jTextField1 = new JTextField();  JLabel jLabel3 = new JLabel();  JTextField jTextField2 = new JTextField();  JLabel jLabel4 = new JLabel();  JTextField jTextField3 = new JTextField();  JLabel jLabel5 = new JLabel();  JTextField jTextField4 = new JTextField();  JButton jButton1 = new JButton();  JScrollPane jScrollPane1 = new JScrollPane();  JTextArea showmessage = new JTextArea();  //Construct the frame  public addbook1() {    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(500, 400));    this.setTitle("Frame Title");    jLabel2.setFont(new java.awt.Font("SansSerif", 0, 15));    jLabel2.setText("书名");    jTextField1.setText("");    jLabel3.setFont(new java.awt.Font("SansSerif", 0, 15));    jLabel3.setText("作者");    jTextField2.setText("");    jLabel4.setFont(new java.awt.Font("SansSerif", 0, 15));    jLabel4.setText("ISSN");    jTextField3.setText("");    jLabel5.setFont(new java.awt.Font("SansSerif", 0, 15));    jLabel5.setText("地点");    jButton1.setFont(new java.awt.Font("SansSerif", 0, 15));    jButton1.setText("提交");    jButton1.addActionListener(new addbook1_jButton1_actionAdapter(this));    showmessage.setText("");    contentPane.add(jLabel1,  new XYConstraints(118, 7, 127, 36));    contentPane.add(jTextField1,     new XYConstraints(86, 77, 123, 29));    contentPane.add(jLabel2, new XYConstraints(58, 80, 39, 28));    contentPane.add(jLabel3,     new XYConstraints(58, 117, -1, 28));    contentPane.add(jTextField2,     new XYConstraints(88, 119, 122, 29));    contentPane.add(jTextField3,      new XYConstraints(87, 158, 123, 32));    contentPane.add(jLabel4, new XYConstraints(54, 157, -1, 25));    contentPane.add(jTextField4,        new XYConstraints(88, 199, 122, 33));    contentPane.add(jLabel5, new XYConstraints(59, 197, -1, 28));    contentPane.add(jButton1,    new XYConstraints(220, 200, -1, 33));    contentPane.add(jScrollPane1,  new XYConstraints(55, 252, 378, 119));    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 output="您已经成功的增加该书刊!!";   output+="\n";   output+="完成操作";   showmessage.setText(output);  }}class addbook1_jButton1_actionAdapter implements java.awt.event.ActionListener {  addbook1 adaptee;  addbook1_jButton1_actionAdapter(addbook1 adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton1_actionPerformed(e);  }}

⌨️ 快捷键说明

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