📄 frausersearch.java~2~
字号:
package 毕业设计;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentAdapter;
public class fraUserSearch 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 lblAge = new JLabel();
JTextField txtAge = 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();
JTable tblDisplay = new JTable();
JLabel lblDisplay = new JLabel();
JLabel lblSearchLine = new JLabel();
TitledBorder titledBorder2 = new TitledBorder("");
public fraUserSearch() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(null);
setSize(new Dimension(700, 530));
this.addComponentListener(new fraUserSearch_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.white);
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.white);
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.white);
txtTel.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtTel.setEditable(false);
txtTel.setText("");
txtTel.setBounds(new Rectangle(285, 92, 119, 28));
lblAge.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblAge.setText("年 龄:");
lblAge.setBounds(new Rectangle(214, 18, 90, 26));
txtAge.setBackground(Color.white);
txtAge.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
txtAge.setEditable(false);
txtAge.setText("");
txtAge.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.setEditable(false);
txtRemark.setText("");
txtRemark.setBounds(new Rectangle(64, 204, 340, 93));
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.white);
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.white);
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("查询");
btnCancel.setBounds(new Rectangle(451, 237, 80, 28));
btnCancel.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
btnCancel.setText("清空");
btnExit.setBounds(new Rectangle(566, 238, 75, 28));
btnExit.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
btnExit.setText("退出");
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.white);
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.white);
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.white);
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(16, 348, 670, 145));
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));
pnlUserMessage.add(lblAge);
pnlUserMessage.add(txtAge);
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);
pnlUserMessage.add(txtSearchId);
pnlUserMessage.add(txtSearchName);
pnlUserMessage.add(lblSearchId);
pnlUserMessage.add(lblSearchPopedom);
pnlUserMessage.add(txtSearchPopedom);
pnlUserMessage.add(rbnExactSearch);
pnlUserMessage.add(rbnBlurrySearch);
pnlUserMessage.add(btnExit);
pnlUserMessage.add(btnCancel);
pnlUserMessage.add(btnSearch);
pnlUserMessage.add(lblLine);
pnlUserMessage.add(lblSearchLine);
this.getContentPane().add(pnlUserMessage);
this.getContentPane().add(tblDisplay);
this.getContentPane().add(lblDisplay);
rbnExactSearch.setSelected(true);
}
public void ShowUserSearch()
{
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) {
pnlUserMessage.setSize((this.getWidth() - pnlUserMessage.getWidth())/2,0);
tblDisplay.setLocation(this.getWidth()-30,this.getHeight()-30);
}
}
class fraUserSearch_this_componentAdapter extends ComponentAdapter {
private fraUserSearch adaptee;
fraUserSearch_this_componentAdapter(fraUserSearch adaptee) {
this.adaptee = adaptee;
}
public void componentResized(ComponentEvent e) {
adaptee.this_componentResized(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -