?? searchstudentui.java
字號:
package view;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;
//學(xué)生窗口 對學(xué)生信息 修改 刪除
public class searchstudentUI extends JFrame {
private JComboBox cbsstatus;
private JComboBox cbsclass;
private JComboBox cbszhuanye;
private JTextField tfsindate;
private JTextField tfsage;
private JTextField tfsname;
private JTable tablesearchs;
private ButtonGroup ssex = new ButtonGroup();
//---
public searchstudentUI() {
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);//關(guān)閉方式
setTitle("不暈校園管理系統(tǒng)->學(xué)生修改");
getContentPane().setLayout(null);
setSize(772,317);
final JPanel sspanel = new JPanel();
sspanel.setBorder(new TitledBorder(null, "查詢結(jié)果", TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION, null, null));
sspanel.setLayout(null);
sspanel.setBounds(326, 6, 414, 256);
getContentPane().add(sspanel);
final JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(11, 31, 393, 203);
sspanel.add(scrollPane);
tablesearchs = new JTable();
scrollPane.setViewportView(tablesearchs);
setVisible(true); //窗口顯示
final JPanel panel = new JPanel();
panel.setBorder(new TitledBorder(null, "查詢條件", TitledBorder.LEFT, TitledBorder.DEFAULT_POSITION, null, null));
panel.setLayout(null);
panel.setBounds(15, 10, 305, 252);
getContentPane().add(panel);
final JCheckBox checkBox = new JCheckBox();
checkBox.setText("使用");
checkBox.setBounds(10, 20, 55, 23);
panel.add(checkBox);
final JCheckBox checkBox_1 = new JCheckBox();
checkBox_1.setText("使用");
checkBox_1.setBounds(10, 45, 55, 23);
panel.add(checkBox_1);
final JCheckBox checkBox_2 = new JCheckBox();
checkBox_2.setText("使用");
checkBox_2.setBounds(10, 72, 55, 23);
panel.add(checkBox_2);
final JCheckBox checkBox_2_1 = new JCheckBox();
checkBox_2_1.setText("使用");
checkBox_2_1.setBounds(10, 97, 55, 23);
panel.add(checkBox_2_1);
final JCheckBox checkBox_3 = new JCheckBox();
checkBox_3.setText("使用");
checkBox_3.setBounds(10, 125, 55, 23);
panel.add(checkBox_3);
final JCheckBox checkBox_4 = new JCheckBox();
checkBox_4.setText("使用");
checkBox_4.setBounds(10, 154, 55, 23);
panel.add(checkBox_4);
final JCheckBox checkBox_5 = new JCheckBox();
checkBox_5.setText("使用");
checkBox_5.setBounds(10, 183, 55, 23);
panel.add(checkBox_5);
final JButton btsstudent = new JButton();
btsstudent.setText("查詢");
btsstudent.setBounds(31, 212, 77, 28);
panel.add(btsstudent);
final JLabel label_4_1_2_1 = new JLabel();
label_4_1_2_1.setText("學(xué)生狀態(tài):");
label_4_1_2_1.setBounds(71, 183, 66, 18);
panel.add(label_4_1_2_1);
final JLabel label_4_1_2_1_1_1 = new JLabel();
label_4_1_2_1_1_1.setText("所在班級:");
label_4_1_2_1_1_1.setBounds(71, 155, 66, 18);
panel.add(label_4_1_2_1_1_1);
final JLabel label_4_1_2_1_1 = new JLabel();
label_4_1_2_1_1.setText("所選專業(yè):");
label_4_1_2_1_1.setBounds(71, 127, 66, 18);
panel.add(label_4_1_2_1_1);
final JLabel label_4_1 = new JLabel();
label_4_1.setText("入學(xué)年份:");
label_4_1.setBounds(71, 99, 66, 18);
panel.add(label_4_1);
final JLabel label_4 = new JLabel();
label_4.setText("學(xué)生年齡:");
label_4.setBounds(71, 74, 66, 18);
panel.add(label_4);
final JLabel label_1 = new JLabel();
label_1.setText("學(xué)生性別:");
label_1.setBounds(71, 50, 66, 18);
panel.add(label_1);
final JLabel label = new JLabel();
label.setText("學(xué)生姓名:");
label.setBounds(71, 22, 66, 18);
panel.add(label);
tfsname = new JTextField();
tfsname.setBounds(138, 22, 66, 22);
panel.add(tfsname);
final JRadioButton man = new JRadioButton();
ssex.add(man);
man.setSelected(true);
man.setText("男");
man.setBounds(132, 50, 39, 18);
panel.add(man);
final JRadioButton woman = new JRadioButton();
ssex.add(woman);
woman.setText("女");
woman.setBounds(177, 50, 55, 18);
panel.add(woman);
tfsage = new JTextField();
tfsage.setBounds(138, 74, 66, 22);
panel.add(tfsage);
tfsindate = new JTextField();
tfsindate.setBounds(138, 99, 66, 22);
panel.add(tfsindate);
cbszhuanye = new JComboBox();
cbszhuanye.setBounds(138, 127, 163, 22);
panel.add(cbszhuanye);
cbsclass = new JComboBox();
cbsclass.setBounds(138, 155, 163, 22);
panel.add(cbsclass);
cbsstatus = new JComboBox();
cbsstatus.setBounds(138, 183, 163, 22);
panel.add(cbsstatus);
final JButton btmostudent = new JButton();
btmostudent.setText("修改");
btmostudent.setBounds(128, 212, 77, 28);
panel.add(btmostudent);
final JButton btexit = new JButton();
btexit.setText("退出");
btexit.setBounds(224, 212, 77, 28);
panel.add(btexit);
final JLabel label_2 = new JLabel();
label_2.setText("歲");
label_2.setBounds(207, 76, 29, 15);
panel.add(label_2);
}//end struct
// start main
public static void main(String[] args) {
new searchstudentUI();
}//end main
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -