?? frmusersearch.java~61~
字號:
package 畢業設計;
import java.awt.*;
import java.util.Vector;
import javax.swing.*;
import javax.swing.JTable;
import javax.swing.border.TitledBorder;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentAdapter;
import javax.swing.table.JTableHeader;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.table.DefaultTableModel;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
public class frmUserSearch extends JFrame {
JLabel lblId = new JLabel();
JTextField txtId = new JTextField();
JLabel lblName = new JLabel();
JTextField txtName = new JTextField();
JLabel lblSex = new JLabel();
JTextField txtTel = new JTextField();
JLabel lblBirthTime = new JLabel();
JTextField txtBirthTime = new JTextField();
JLabel lblRemark = new JLabel();
JTextArea txtRemark = new JTextArea();
JLabel lblTel = new JLabel();
JLabel lblAddress = new JLabel();
JTextField txtIdentityCard = new JTextField();
JLabel lblIdentityCard = new JLabel();
JTextField txtAddress = new JTextField();
JButton btnSearch = new JButton();
JButton btnCancel = new JButton();
JButton btnExit = new JButton();
JLabel lblPassword = new JLabel();
JLabel lblPopedom = new JLabel();
TitledBorder titledBorder1 = new TitledBorder("");
JLabel lblLine = new JLabel();
JTextField txtPopedom = new JTextField();
JTextField txtSex = new JTextField();
JTextField txtPassword = new JTextField();
JPanel pnlUserMessage = new JPanel();
JLabel lblSearchId = new JLabel();
JTextField txtSearchId = new JTextField();
JLabel lblSearchName = new JLabel();
JTextField txtSearchName = new JTextField();
JLabel lblSearchPopedom = new JLabel();
JTextField txtSearchPopedom = new JTextField();
JRadioButton rbnExactSearch = new JRadioButton();
JRadioButton rbnBlurrySearch = new JRadioButton();
JLabel lblDisplay = new JLabel();
JLabel lblSearchLine = new JLabel();
TitledBorder titledBorder2 = new TitledBorder("");
DefaultTableModel dt;
Vector vtColName = new Vector();
Vector vt;
boolean isnot;
String []column = {"卡號","密碼","權限","姓名","性別","出生年月","身份證號","電話","地址","備注"};
JTable tblDisplay = new JTable();
ButtonGroup buttonGroup1 = new ButtonGroup();
JScrollPane jScrollPane1 = new JScrollPane();
public frmUserSearch() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(null);
setSize(new Dimension(700, 530));
this.setTitle("用戶查詢");
this.addComponentListener(new frmUserSearch_this_componentAdapter(this));
lblId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblId.setText("卡 號:");
lblId.setBounds(new Rectangle(24, 16, 50, 28));
txtId.setBackground(Color.lightGray);
txtId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtId.setEditable(false);
txtId.setBounds(new Rectangle(64, 17, 133, 26));
lblName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblName.setText("姓 名:");
lblName.setBounds(new Rectangle(25, 125, 45, 28));
txtName.setBackground(Color.lightGray);
txtName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtName.setEditable(false);
txtName.setText("");
txtName.setBounds(new Rectangle(65, 128, 131, 28));
lblSex.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtTel.setBackground(Color.lightGray);
txtTel.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtTel.setEditable(false);
txtTel.setText("");
txtTel.setBounds(new Rectangle(285, 92, 119, 28));
lblBirthTime.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblBirthTime.setText("出生年月:");
lblBirthTime.setBounds(new Rectangle(214, 18, 71, 26));
txtBirthTime.setBackground(Color.lightGray);
txtBirthTime.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtBirthTime.setEditable(false);
txtBirthTime.setText("");
txtBirthTime.setBounds(new Rectangle(286, 18, 119, 28));
lblRemark.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblRemark.setText("備 注:");
lblRemark.setBounds(new Rectangle(24, 199, 47, 26));
txtRemark.setBackground(Color.lightGray);
txtRemark.setEditable(false);
txtRemark.setText("");
txtRemark.setBounds(new Rectangle(64, 204, 340, 93));
txtRemark.setLineWrap(true);
lblSex.setText("性 別:");
lblSex.setBounds(new Rectangle(212, 56, 77, 28));
lblTel.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblTel.setText("電 話:");
lblTel.setBounds(new Rectangle(214, 92, 79, 28));
lblAddress.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblAddress.setText("地 址:");
lblAddress.setBounds(new Rectangle(24, 165, 40, 28));
txtIdentityCard.setBackground(Color.lightGray);
txtIdentityCard.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtIdentityCard.setEditable(false);
txtIdentityCard.setText("");
txtIdentityCard.setBounds(new Rectangle(285, 129, 120, 28));
lblIdentityCard.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblIdentityCard.setText("身份證號:");
lblIdentityCard.setBounds(new Rectangle(212, 128, 81, 28));
txtAddress.setBackground(Color.lightGray);
txtAddress.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtAddress.setEditable(false);
txtAddress.setText("");
txtAddress.setBounds(new Rectangle(65, 165, 339, 28));
btnSearch.setBounds(new Rectangle(512, 182, 75, 28));
btnSearch.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
btnSearch.setText("查詢");
btnSearch.addActionListener(new frmUserSearch_btnSearch_actionAdapter(this));
btnCancel.setBounds(new Rectangle(451, 237, 80, 28));
btnCancel.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
btnCancel.setText("清空");
btnCancel.addActionListener(new frmUserSearch_btnCancel_actionAdapter(this));
btnExit.setBounds(new Rectangle(566, 238, 75, 28));
btnExit.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
btnExit.setText("退出");
btnExit.addActionListener(new frmUserSearch_btnExit_actionAdapter(this));
lblPassword.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblPassword.setText("密 碼:");
lblPassword.setBounds(new Rectangle(24, 51, 46, 32));
lblPopedom.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblPopedom.setText("權 限:");
lblPopedom.setBounds(new Rectangle(25, 91, 48, 27));
lblLine.setBorder(titledBorder1);
lblLine.setText("");
lblLine.setBounds(new Rectangle(17, 10, 669, 297));
txtPopedom.setBackground(Color.lightGray);
txtPopedom.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtPopedom.setEditable(false);
txtPopedom.setText("");
txtPopedom.setBounds(new Rectangle(64, 93, 132, 26));
txtSex.setBackground(Color.lightGray);
txtSex.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtSex.setEditable(false);
txtSex.setText("");
txtSex.setBounds(new Rectangle(286, 56, 119, 25));
txtPassword.setBackground(Color.lightGray);
txtPassword.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtPassword.setEditable(false);
txtPassword.setText("");
txtPassword.setBounds(new Rectangle(64, 54, 132, 26));
pnlUserMessage.setBounds(new Rectangle( -1, 0, 701, 308));
pnlUserMessage.setLayout(null);
lblSearchId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblSearchId.setText("卡 號:");
lblSearchId.setBounds(new Rectangle(430, 20, 48, 27));
txtSearchId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtSearchId.setText("");
txtSearchId.setBounds(new Rectangle(477, 19, 198, 27));
lblSearchName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblSearchName.setText("姓 名:");
lblSearchName.setBounds(new Rectangle(431, 55, 45, 27));
txtSearchName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtSearchName.setText("");
txtSearchName.setBounds(new Rectangle(476, 56, 199, 26));
lblSearchPopedom.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblSearchPopedom.setText("權 限:");
lblSearchPopedom.setBounds(new Rectangle(431, 94, 42, 25));
txtSearchPopedom.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtSearchPopedom.setText("");
txtSearchPopedom.setBounds(new Rectangle(477, 92, 198, 30));
rbnExactSearch.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
rbnExactSearch.setText("精確查詢");
rbnExactSearch.setBounds(new Rectangle(434, 129, 95, 26));
rbnBlurrySearch.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
rbnBlurrySearch.setText("模糊查詢");
rbnBlurrySearch.setBounds(new Rectangle(568, 128, 90, 29));
tblDisplay.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
tblDisplay.setBounds(new Rectangle(20, 354, 662, 154));
tblDisplay.addMouseListener(new frmUserSearch_tblDisplay_mouseAdapter(this));
lblDisplay.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblDisplay.setText("查詢結果");
lblDisplay.setBounds(new Rectangle(364, 308, 80, 19));
lblSearchLine.setBorder(BorderFactory.createRaisedBevelBorder());
lblSearchLine.setBounds(new Rectangle(420, 13, 263, 290));
jScrollPane1.setBounds(new Rectangle(18, 335, 667, 165));
pnlUserMessage.add(lblBirthTime);
pnlUserMessage.add(txtBirthTime);
pnlUserMessage.add(txtRemark);
pnlUserMessage.add(txtPopedom);
pnlUserMessage.add(txtName);
pnlUserMessage.add(txtSex);
pnlUserMessage.add(txtAddress);
pnlUserMessage.add(lblSex);
pnlUserMessage.add(lblTel);
pnlUserMessage.add(lblIdentityCard);
pnlUserMessage.add(txtIdentityCard);
pnlUserMessage.add(txtTel);
pnlUserMessage.add(txtId);
pnlUserMessage.add(lblId);
pnlUserMessage.add(txtPassword);
pnlUserMessage.add(lblPassword);
pnlUserMessage.add(lblPopedom);
pnlUserMessage.add(lblName);
pnlUserMessage.add(lblAddress);
pnlUserMessage.add(lblRemark);
pnlUserMessage.add(lblSearchName);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -