?? fralibdelete.java~1~
字號:
package 畢業設計;
import java.awt.BorderLayout;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.*;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentAdapter;
public class fraLibDelete extends JFrame {
JLabel lblId = new JLabel();
JTextField txtId = new JTextField();
JLabel lblBarCode = new JLabel();
JTextField txtBarCode = new JTextField();
JLabel lblName = new JLabel();
JTextField txtName = new JTextField();
JLabel lblAuthor = new JLabel();
JTextField txtAuthor = new JTextField();
JLabel lblSynopsis = new JLabel();
JLabel lblPublish = new JLabel();
JLabel lblPrice = new JLabel();
JLabel lblSort = new JLabel();
JLabel lblIntoTime = new JLabel();
JLabel lblLocation = new JLabel();
JTextField txtPrice = new JTextField();
JTextField txtIntoTime = new JTextField();
JLabel lblIsbn = new JLabel();
JTextField txtIsbn = new JTextField();
JTextField txtLocation = new JTextField();
JButton btnFind = new JButton();
JButton btnCancel = new JButton();
JButton btnExit = new JButton();
JLabel lblLine = new JLabel();
JLabel lblPage = new JLabel();
JTextField txtPage = new JTextField();
JLabel lblFindId = new JLabel();
JTextField txtFindId = new JTextField();
JLabel lblFindBarCode = new JLabel();
JTextField txtFindBarCode = new JTextField();
JLabel lblFindName = new JLabel();
JTextField txtFindName = new JTextField();
JLabel lblFindAuthor = new JLabel();
JTextField txtFindAuthor = new JTextField();
JLabel lblFindPublish = new JLabel();
JTextField txtFindPublish = new JTextField();
JLabel lblFindSort = new JLabel();
JTextField txtFindSort = new JTextField();
JRadioButton rbnExactSearch = new JRadioButton();
JRadioButton rbnBlurrySearch = new JRadioButton();
JTextField txtPublish = new JTextField();
JTextField txtSort = new JTextField();
JLabel lblIsin = new JLabel();
JTextField txtIsin = new JTextField();
JTextArea txtSynopsis = new JTextArea();
JPanel pnlFind = new JPanel();
JTable tblArray = new JTable();
JLabel lblLibDisplay = new JLabel();
JLabel lblBorrowCount = new JLabel();
JTextField txtBorrowCount = new JTextField();
ButtonGroup buttonGroup1 = new ButtonGroup();
JButton btnDelete = new JButton();
public fraLibDelete() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(null);
setSize(new Dimension(800, 600));
this.addComponentListener(new fraLibFind_this_componentAdapter(this));
lblId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblId.setText("編 號:");
lblId.setBounds(new Rectangle(334, 23, 56, 24));
txtId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtId.setEditable(false);
txtId.setBounds(new Rectangle(391, 24, 156, 24));
lblBarCode.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblBarCode.setText("條 形 碼:");
lblBarCode.setBounds(new Rectangle(334, 56, 51, 23));
txtBarCode.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtBarCode.setEditable(false);
txtBarCode.setText("");
txtBarCode.setBounds(new Rectangle(392, 54, 156, 23));
lblName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtName.setEditable(false);
txtName.setText("");
txtName.setBounds(new Rectangle(393, 86, 155, 26));
lblAuthor.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblAuthor.setText("作 者:");
lblAuthor.setBounds(new Rectangle(332, 115, 51, 24));
txtAuthor.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtAuthor.setEditable(false);
txtAuthor.setText("");
txtAuthor.setBounds(new Rectangle(393, 119, 153, 23));
lblSynopsis.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblSynopsis.setText("簡 介:");
lblSynopsis.setBounds(new Rectangle(569, 148, 55, 22));
lblName.setText("名 稱:");
lblName.setBounds(new Rectangle(334, 86, 50, 23));
lblPublish.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblPublish.setText("出 版 社:");
lblPublish.setBounds(new Rectangle(333, 145, 55, 23));
lblPrice.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblPrice.setText("價 格:");
lblPrice.setBounds(new Rectangle(333, 207, 50, 19));
lblSort.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblSort.setText("類 別:");
lblSort.setBounds(new Rectangle(332, 264, 61, 22));
lblIntoTime.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblIntoTime.setText("入庫時間:");
lblIntoTime.setBounds(new Rectangle(569, 56, 56, 26));
lblLocation.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblLocation.setText("存放位置:");
lblLocation.setBounds(new Rectangle(569, 86, 56, 28));
txtPrice.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtPrice.setEditable(false);
txtPrice.setText("");
txtPrice.setBounds(new Rectangle(393, 177, 153, 22));
txtIntoTime.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtIntoTime.setEditable(false);
txtIntoTime.setText("");
txtIntoTime.setBounds(new Rectangle(633, 56, 143, 25));
lblIsbn.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblIsbn.setText("I S B N:");
lblIsbn.setBounds(new Rectangle(333, 175, 50, 22));
txtIsbn.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtIsbn.setEditable(false);
txtIsbn.setText("");
txtIsbn.setBounds(new Rectangle(393, 205, 155, 24));
txtLocation.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtLocation.setEditable(false);
txtLocation.setText("");
txtLocation.setBounds(new Rectangle(632, 87, 143, 25));
btnFind.setBounds(new Rectangle(126, 220, 67, 27));
btnFind.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
btnFind.setText("查詢");
btnCancel.setBounds(new Rectangle(125, 258, 66, 27));
btnCancel.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
btnCancel.setText("清空");
btnExit.setBounds(new Rectangle(220, 257, 65, 28));
btnExit.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
btnExit.setText("退出");
lblLine.setBorder(BorderFactory.createEtchedBorder());
lblLine.setText("");
lblLine.setBounds(new Rectangle(15, 7, 772, 291));
lblPage.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblPage.setText("總 頁 數:");
lblPage.setBounds(new Rectangle(333, 235, 54, 25));
txtPage.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtPage.setEditable(false);
txtPage.setText("");
txtPage.setBounds(new Rectangle(392, 235, 156, 23));
lblFindId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblFindId.setText("圖書編號:");
lblFindId.setBounds(new Rectangle(25, 23, 61, 26));
txtFindId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtFindId.setText("");
txtFindId.setBounds(new Rectangle(83, 25, 229, 24));
lblFindBarCode.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblFindBarCode.setText("條 形 碼:");
lblFindBarCode.setBounds(new Rectangle(25, 61, 61, 21));
txtFindBarCode.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtFindBarCode.setText("");
txtFindBarCode.setBounds(new Rectangle(83, 58, 229, 25));
lblFindName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblFindName.setText("圖書名稱:");
lblFindName.setBounds(new Rectangle(23, 92, 63, 19));
txtFindName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtFindName.setText("");
txtFindName.setBounds(new Rectangle(83, 89, 229, 24));
lblFindAuthor.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblFindAuthor.setText("圖書作者:");
lblFindAuthor.setBounds(new Rectangle(23, 118, 62, 22));
txtFindAuthor.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtFindAuthor.setText("");
txtFindAuthor.setBounds(new Rectangle(84, 118, 227, 24));
lblFindPublish.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblFindPublish.setText("出 版 社:");
lblFindPublish.setBounds(new Rectangle(24, 146, 59, 22));
txtFindPublish.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtFindPublish.setText("");
txtFindPublish.setBounds(new Rectangle(84, 148, 227, 23));
lblFindSort.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblFindSort.setText("圖書類別:");
lblFindSort.setBounds(new Rectangle(23, 177, 62, 22));
txtFindSort.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtFindSort.setText("");
txtFindSort.setBounds(new Rectangle(84, 176, 227, 24));
rbnExactSearch.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
rbnExactSearch.setText("精確查找");
rbnExactSearch.setBounds(new Rectangle(24, 219, 75, 26));
rbnBlurrySearch.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
rbnBlurrySearch.setText("模糊查找");
rbnBlurrySearch.setBounds(new Rectangle(23, 246, 74, 27));
txtPublish.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtPublish.setEditable(false);
txtPublish.setText("");
txtPublish.setBounds(new Rectangle(392, 148, 154, 21));
txtSort.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtSort.setEditable(false);
txtSort.setText("");
txtSort.setBounds(new Rectangle(392, 266, 157, 23));
lblIsin.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblIsin.setText("是否在庫:");
lblIsin.setBounds(new Rectangle(568, 22, 60, 24));
txtIsin.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtIsin.setEditable(false);
txtIsin.setText("");
txtIsin.setBounds(new Rectangle(633, 21, 143, 26));
txtSynopsis.setFont(new java.awt.Font("Dialog", Font.PLAIN, 11));
txtSynopsis.setEditable(false);
txtSynopsis.setText("");
txtSynopsis.setBounds(new Rectangle(571, 175, 206, 116));
pnlFind.setBorder(null);
pnlFind.setBounds(new Rectangle( -1, 0, 801, 309));
pnlFind.setLayout(null);
tblArray.setBounds(new Rectangle(13, 346, 773, 222));
lblLibDisplay.setText("圖書列表");
lblLibDisplay.setBounds(new Rectangle(399, 305, 77, 20));
lblBorrowCount.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblBorrowCount.setText("借出次數:");
lblBorrowCount.setBounds(new Rectangle(569, 122, 58, 23));
txtBorrowCount.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
txtBorrowCount.setEditable(false);
txtBorrowCount.setText("");
txtBorrowCount.setBounds(new Rectangle(633, 119, 142, 26));
btnDelete.setBounds(new Rectangle(219, 220, 65, 28));
btnDelete.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
btnDelete.setText("刪除");
pnlFind.add(lblFindId);
pnlFind.add(txtFindId);
pnlFind.add(txtFindBarCode);
pnlFind.add(lblFindBarCode);
pnlFind.add(lblFindName);
pnlFind.add(txtFindName);
pnlFind.add(lblFindAuthor);
pnlFind.add(txtFindAuthor);
pnlFind.add(txtFindPublish);
pnlFind.add(lblFindSort);
pnlFind.add(txtFindSort);
pnlFind.add(txtId);
pnlFind.add(txtLocation);
pnlFind.add(txtIntoTime);
pnlFind.add(lblIntoTime);
pnlFind.add(txtBarCode);
pnlFind.add(txtName);
pnlFind.add(txtAuthor);
pnlFind.add(txtPublish);
pnlFind.add(txtPrice);
pnlFind.add(txtIsbn);
pnlFind.add(txtPage);
pnlFind.add(lblId);
pnlFind.add(lblBarCode);
pnlFind.add(lblName);
pnlFind.add(lblAuthor);
pnlFind.add(lblPublish);
pnlFind.add(lblIsbn);
pnlFind.add(lblPrice);
pnlFind.add(lblPage);
pnlFind.add(lblFindPublish);
pnlFind.add(lblSort);
pnlFind.add(txtSort);
pnlFind.add(txtIsin);
pnlFind.add(lblIsin);
pnlFind.add(txtSynopsis);
pnlFind.add(lblSynopsis);
pnlFind.add(txtBorrowCount);
pnlFind.add(lblBorrowCount);
pnlFind.add(lblLocation);
pnlFind.add(btnCancel);
pnlFind.add(lblLine);
pnlFind.add(btnExit);
pnlFind.add(btnFind);
pnlFind.add(rbnExactSearch);
pnlFind.add(rbnBlurrySearch);
pnlFind.add(btnDelete);
this.getContentPane().add(pnlFind);
this.getContentPane().add(tblArray);
this.getContentPane().add(lblLibDisplay);
buttonGroup1.add(rbnExactSearch);
buttonGroup1.add(rbnBlurrySearch);
rbnExactSearch.setSelected(true);
}
public void ShowLibDelete()
{
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension dlgSize = this.getSize();
if (dlgSize.height > screenSize.height) {
dlgSize.height = screenSize.height;
}
if (dlgSize.width > screenSize.width) {
dlgSize.width = screenSize.width;
}
this.setLocation((screenSize.width - dlgSize.width) / 2,
(screenSize.height - dlgSize.height) / 2);
this.setVisible(true);
}
public void this_componentResized(ComponentEvent e) {
tblArray.setSize(this.getWidth()-35,this.getHeight()-35);
pnlFind.setLocation((this.getWidth() - pnlFind.getWidth())/2,0);
}
}
class fraLibDelete_this_componentAdapter extends ComponentAdapter {
private fraLibDelete adaptee;
fraLibDelete_this_componentAdapter(fraLibDelete adaptee) {
this.adaptee = adaptee;
}
public void componentResized(ComponentEvent e) {
adaptee.this_componentResized(e);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -