?? bookborrowbean.java
字號:
package com.jlib.client;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.BevelBorder;
@SuppressWarnings("serial")
public class BookBorrowBean extends JDialog {
private JTextField textField_1;
private JTextField textField;
/**
* Launch the application
* @param args
*/
public static void main(String args[]) {
try {
UIManager.setLookAndFeel("com.nilo.plaf.nimrod.NimRODLookAndFeel");
} catch (ClassNotFoundException e1) {
// TODO 自動生成 catch 塊
e1.printStackTrace();
} catch (InstantiationException e1) {
// TODO 自動生成 catch 塊
e1.printStackTrace();
} catch (IllegalAccessException e1) {
// TODO 自動生成 catch 塊
e1.printStackTrace();
} catch (UnsupportedLookAndFeelException e1) {
// TODO 自動生成 catch 塊
e1.printStackTrace();
}
try {
BookBorrowBean dialog = new BookBorrowBean();
dialog.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the dialog
*/
public BookBorrowBean() {
super();
getContentPane().setLayout(null);
setTitle("借閱/歸還");
setBounds(100, 100, 279, 176);
final JLabel label = new JLabel();
label.setText("讀者ID:");
label.setBounds(33, 10, 42, 22);
getContentPane().add(label);
textField = new JTextField();
textField.setBorder(new BevelBorder(BevelBorder.LOWERED));
textField.setBounds(81, 12, 142, 20);
getContentPane().add(textField);
final JLabel isbnLabel = new JLabel();
isbnLabel.setText("ISBN:");
isbnLabel.setBounds(33, 54, 30, 20);
getContentPane().add(isbnLabel);
textField_1 = new JTextField();
textField_1.setBorder(new BevelBorder(BevelBorder.LOWERED));
textField_1.setBounds(81, 55, 142, 20);
getContentPane().add(textField_1);
final JButton button = new JButton();
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
com.jlib.client.BookBorrowFun bbf = new com.jlib.client.BookBorrowFun();
bbf.borrow(com.jlib.client.LoginBean.IP, com.jlib.client.LoginBean.PORT,textField.getText() , textField_1.getText());
bbf.start();
}
});
button.setText("借 閱");
button.setBounds(46, 105, 75, 23);
getContentPane().add(button);
final JButton button_1 = new JButton();
button_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
com.jlib.client.BookBorrowBean.this.setVisible(false);
}
});
button_1.setText("取 消");
button_1.setBounds(149, 105, 75, 23);
getContentPane().add(button_1);
//
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -