?? classui.java
字號:
package view;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
//班級窗口 對班級信息修改和刪除
public class classUI extends JFrame implements ActionListener {
private JComboBox cbbossname_1;
private JTextField classnumber;
private JComboBox cbcday;
private JComboBox cbcmonth;
private JTextField tfcyear;
private JTextField classname;
private JTextField studentsum;
private JComboBox cbbossname;
private JTextArea classbeizhu;
public classUI() {
this.setSize(600,413); //窗口大小
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);//關閉方式
getContentPane().setLayout(null);
setTitle("不暈校園管理系統->班級信息修改");
final JButton btmodifyclass = new JButton();
btmodifyclass.setText("修改");
btmodifyclass.setBounds(27, 338, 106, 28);
getContentPane().add(btmodifyclass);
final JLabel label_1_1 = new JLabel();
label_1_1.setText("班主任名:");
label_1_1.setBounds(27, 171, 66, 18);
getContentPane().add(label_1_1);
cbbossname = new JComboBox();
cbbossname.setBounds(94, 167, 150, 27);
getContentPane().add(cbbossname);
studentsum = new JTextField();
studentsum.setBounds(94, 133, 150, 22);
getContentPane().add(studentsum);
final JLabel label_1 = new JLabel();
label_1.setText("班級人數:");
label_1.setBounds(27, 135, 66, 18);
getContentPane().add(label_1);
final JLabel label = new JLabel();
label.setText("班級名稱:");
label.setBounds(27, 100, 66, 18);
getContentPane().add(label);
classname = new JTextField();
classname.setBounds(94, 98, 150, 22);
getContentPane().add(classname);
tfcyear = new JTextField();
tfcyear.setBounds(94, 59, 39, 22);
getContentPane().add(tfcyear);
final JLabel label_6 = new JLabel();
label_6.setText("開班日期:");
label_6.setBounds(27, 61, 66, 18);
getContentPane().add(label_6);
final JLabel label_7 = new JLabel();
label_7.setText("年");
label_7.setBounds(132, 61, 13, 18);
getContentPane().add(label_7);
cbcmonth = new JComboBox();
cbcmonth.setModel(new DefaultComboBoxModel(new String[] {"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"}));
cbcmonth.setSelectedIndex(1);
cbcmonth.setBounds(147, 61, 55, 18);
getContentPane().add(cbcmonth);
cbcday = new JComboBox();
cbcday.setModel(new DefaultComboBoxModel(new String[] {"1日", "2日", "3日", "4日", "5日", "6日", "7日", "8日", "9日", "10日", "11日", "12日", "13日", "14日", "15日", "16日", "17日", "18日", "19日", "20日", "21日", "22日", "23日", "24日", "25日", "26日", "27日", "28日", "29日", "30日", "31日"}));
cbcday.setBounds(202, 61, 55, 18);
getContentPane().add(cbcday);
classnumber = new JTextField();
classnumber.setEditable(false);
classnumber.setBounds(94, 24, 150, 22);
getContentPane().add(classnumber);
final JLabel label_2 = new JLabel();
label_2.setText("班級編號:");
label_2.setBounds(27, 26, 66, 18);
getContentPane().add(label_2);
final JLabel label_3 = new JLabel();
label_3.setText("注意:班級編號自動生成任何人不得更改");
label_3.setBounds(257, 26, 270, 18);
getContentPane().add(label_3);
final JButton btexit = new JButton();
btexit.setText("退出");
btexit.setBounds(447, 338, 106, 28);
getContentPane().add(btexit);
final JButton btdelclass = new JButton();
btdelclass.setText("刪除");
btdelclass.setBounds(246, 338, 106, 28);
getContentPane().add(btdelclass);
setResizable(false);
final JLabel label_3_1 = new JLabel();
label_3_1.setText("*必需填寫 不能為空");
label_3_1.setBounds(257, 100, 140, 18);
getContentPane().add(label_3_1);
final JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(94, 253, 459, 79);
getContentPane().add(scrollPane);
classbeizhu = new JTextArea();
scrollPane.setViewportView(classbeizhu);
final JLabel label_1_2 = new JLabel();
label_1_2.setText("班級備注:");
label_1_2.setBounds(27, 243, 66, 18);
getContentPane().add(label_1_2);
final JLabel label_1_1_1 = new JLabel();
label_1_1_1.setText("班級狀態:");
label_1_1_1.setBounds(25, 209, 66, 18);
getContentPane().add(label_1_1_1);
cbbossname_1 = new JComboBox();
cbbossname_1.setModel(new DefaultComboBoxModel(new String[] {"新開班", "上課", "停課", "放假", "畢業"}));
cbbossname_1.setBounds(95, 205, 150, 27);
getContentPane().add(cbbossname_1);
this.setVisible(true); //顯示窗口
}
public static void main(String[] args) {
new classUI();
}
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -