?? searchteacherui.java
字號:
package view;
import javax.swing.ButtonGroup;
import javax.swing.DefaultComboBoxModel;
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;
//教師窗口 對教師信息修改與刪除
public class searchteacherUI extends JFrame {
private JTable tablesteacher;
private JComboBox cbtkecheng;
private JComboBox cbtstatus;
private JTextField tftage;
private ButtonGroup tsex = new ButtonGroup();
private JTextField tftname;
private JTextField tftyear;
public searchteacherUI() {
super();
setTitle("不暈校園管理系統(tǒng)->教師修改");
getContentPane().setLayout(null);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); //關(guān)閉方式
this.setSize(845,280);
this.setVisible(true);//顯示窗口
final JPanel ttiaojianpanel = new JPanel();
ttiaojianpanel.setBorder(new TitledBorder(null, "教師查詢條件", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
ttiaojianpanel.setLayout(null);
ttiaojianpanel.setBounds(10, 10, 330, 225);
getContentPane().add(ttiaojianpanel);
final JCheckBox checkBox = new JCheckBox();
checkBox.setBounds(10, 23, 49, 23);
ttiaojianpanel.add(checkBox);
checkBox.setText("使用");
final JCheckBox checkBox_1 = new JCheckBox();
checkBox_1.setBounds(10, 48, 49, 23);
ttiaojianpanel.add(checkBox_1);
checkBox_1.setText("使用");
final JCheckBox checkBox_2 = new JCheckBox();
checkBox_2.setBounds(10, 70, 49, 23);
ttiaojianpanel.add(checkBox_2);
checkBox_2.setText("使用");
final JCheckBox checkBox_3 = new JCheckBox();
checkBox_3.setBounds(10, 95, 49, 23);
ttiaojianpanel.add(checkBox_3);
checkBox_3.setText("使用");
final JCheckBox checkBox_4 = new JCheckBox();
checkBox_4.setBounds(10, 119, 49, 23);
ttiaojianpanel.add(checkBox_4);
checkBox_4.setText("使用");
final JCheckBox checkBox_5 = new JCheckBox();
checkBox_5.setBounds(10, 145, 49, 23);
ttiaojianpanel.add(checkBox_5);
checkBox_5.setText("使用");
final JLabel label_4_1_2_1 = new JLabel();
label_4_1_2_1.setBounds(65, 147, 66, 18);
ttiaojianpanel.add(label_4_1_2_1);
label_4_1_2_1.setText("教師狀態(tài):");
final JLabel label_4_1_2_1_1 = new JLabel();
label_4_1_2_1_1.setBounds(65, 121, 66, 18);
ttiaojianpanel.add(label_4_1_2_1_1);
label_4_1_2_1_1.setText("教師課程:");
final JLabel label_6 = new JLabel();
label_6.setBounds(65, 97, 66, 18);
ttiaojianpanel.add(label_6);
label_6.setText("入職日期:");
final JLabel label_4 = new JLabel();
label_4.setBounds(65, 72, 66, 18);
ttiaojianpanel.add(label_4);
label_4.setText("教師年齡:");
final JLabel label_1 = new JLabel();
label_1.setBounds(65, 50, 66, 18);
ttiaojianpanel.add(label_1);
label_1.setText("教師性別:");
final JLabel label = new JLabel();
label.setBounds(65, 25, 66, 18);
ttiaojianpanel.add(label);
label.setText("教師姓名:");
tftname = new JTextField();
tftname.setBounds(132, 25, 81, 22);
ttiaojianpanel.add(tftname);
final JRadioButton man = new JRadioButton();
man.setBounds(132, 53, 39, 18);
ttiaojianpanel.add(man);
man.setSelected(true);
tsex.add(man);
man.setText("男");
final JRadioButton woman = new JRadioButton();
woman.setBounds(170, 53, 55, 18);
ttiaojianpanel.add(woman);
tsex.add(woman);
woman.setText("女");
tftage = new JTextField();
tftage.setBounds(132, 70, 81, 22);
ttiaojianpanel.add(tftage);
final JLabel label_1_1 = new JLabel();
label_1_1.setBounds(225, 75, 27, 18);
ttiaojianpanel.add(label_1_1);
label_1_1.setText("歲");
tftyear = new JTextField();
tftyear.setBounds(132, 95, 39, 22);
ttiaojianpanel.add(tftyear);
final JLabel label_7 = new JLabel();
label_7.setBounds(175, 95, 13, 18);
ttiaojianpanel.add(label_7);
label_7.setText("年");
cbtkecheng = new JComboBox(); //教師所教課程
cbtkecheng.setBounds(132, 121, 163, 22);
ttiaojianpanel.add(cbtkecheng);
cbtkecheng.setSelectedIndex(1);
cbtstatus = new JComboBox();//教師狀態(tài)下拉列表
cbtstatus.setBounds(132, 147, 163, 22);
ttiaojianpanel.add(cbtstatus);
cbtstatus.setModel(new DefaultComboBoxModel(new String[] {"在職", "休假", "退休"}));
cbtstatus.setSelectedIndex(1);
final JButton btsearcht = new JButton();
btsearcht.setBounds(65, 175, 66, 28);
ttiaojianpanel.add(btsearcht);
btsearcht.setText("查詢");
final JButton btmodifyteacher = new JButton();
btmodifyteacher.setBounds(147, 175, 66, 28);
ttiaojianpanel.add(btmodifyteacher);
btmodifyteacher.setText("修改");
final JButton btexit = new JButton();
btexit.setBounds(229, 175, 66, 28);
ttiaojianpanel.add(btexit);
btexit.setText("退出");
final JPanel tjieguopanel = new JPanel();
tjieguopanel.setLayout(null);
tjieguopanel.setBorder(new TitledBorder(null, "查詢結(jié)果", TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION, null, null));
tjieguopanel.setBounds(352, 10, 471, 225);
getContentPane().add(tjieguopanel);
final JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(10, 23, 454, 192);
tjieguopanel.add(scrollPane);
tablesteacher = new JTable();
scrollPane.setViewportView(tablesteacher);
}
public static void main(String[] args) {
new searchteacherUI();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -