📄 borrow.java~2~
字号:
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 borrow 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(); JButton jButton1 = new JButton(); JScrollPane jScrollPane1 = new JScrollPane(); JTextArea showmessage = new JTextArea(); //Construct the frame public borrow() { 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(400, 300)); 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("书的ISSN"); jTextField2.setText(""); jButton1.setFont(new java.awt.Font("SansSerif", 0, 15)); jButton1.setText("提交"); jButton1.addActionListener(new borrow_jButton1_actionAdapter(this)); showmessage.setText(""); contentPane.add(jLabel1, new XYConstraints(149, 0, 137, 36)); contentPane.add(jLabel2, new XYConstraints(52, 63, -1, 29)); contentPane.add(jTextField1, new XYConstraints(114, 62, 120, 30)); contentPane.add(jLabel3, new XYConstraints(49, 127, 88, 27)); contentPane.add(jTextField2, new XYConstraints(112, 124, 119, 31)); contentPane.add(jButton1, new XYConstraints(234, 125, -1, 30)); contentPane.add(jScrollPane1, new XYConstraints(48, 175, 311, 104)); 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+="\n"; output+="完成操作"; showmessage.setText(output); }}class borrow_jButton1_actionAdapter implements java.awt.event.ActionListener { borrow adaptee; borrow_jButton1_actionAdapter(borrow adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton1_actionPerformed(e); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -