?? itemmanagerframe.java
字號:
/*
* ItemManagerFrame.java
*
* MSE06B班張智力的實(shí)驗(yàn)報(bào)告
*
* 2006年12月11日
*/
package olts.display;
import java.awt.*;
import javax.swing.*;
import java.awt.GridLayout;
import javax.swing.JRadioButton;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import javax.swing.JOptionPane;
import javax.swing.JTextPane;
import javax.swing.JTable;
import javax.swing.table.TableColumn;
import java.awt.FlowLayout;
import javax.swing.JScrollPane;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JComboBox;
import java.awt.Scrollbar;
import javax.swing.JSpinner.NumberEditor;
import olts.dao.ItemMapper;
import olts.item.*;
import olts.util.ErrorRecorder;
/**
* ItemManagerFrame類,繼承了JFrame,生成試題維護(hù)系統(tǒng)的程序界面
*/
public class ItemManagerFrame extends JFrame {
private JPanel jContentPane = null;
private JTabbedPane jTabbedPane = null;
private JPanel jPanel = null;
private JPanel jPanel1 = null;
private JScrollPane jScrollPane = null;
private JTable jTable = null;
private JPanel jPanel2 = null;
private JPanel jPanel3 = null;
private JPanel jPanel4 = null;
private JPanel jPanel5 = null;
private JPanel jPanel6 = null;
private JPanel jPanel7 = null;
private JLabel jLabel = null;
private JComboBox jComboBox = null;
private JLabel jLabel1 = null;
private JTextField jTextField = null;
private JTextField jTextField1 = null;
private JTextField jTextField2 = null;
private JTextField jTextField3 = null;
private JTextField jTextField4 = null;
private JRadioButton jRadioButton = null;
private JRadioButton jRadioButton1 = null;
private JRadioButton jRadioButton2 = null;
private JRadioButton jRadioButton3 = null;
private JLabel jLabel2 = null;
private JComboBox jComboBox1 = null;
private JLabel jLabel3 = null;
private JLabel jLabel4 = null;
private JButton jButton = null;
private JSpinner jspinner = null;
private JSpinner jspinner1 = null;
private JSpinner.NumberEditor numberEditor = null;
private JSpinner.NumberEditor numberEditor1 = null;
private JLabel jLabel5 = null;
private JTextField jTextField5 = null;
public ItemManagerFrame() throws HeadlessException {
super();
// TODO 自動(dòng)生成構(gòu)造函數(shù)存根
initialize();
}
public ItemManagerFrame(GraphicsConfiguration arg0) {
super(arg0);
// TODO 自動(dòng)生成構(gòu)造函數(shù)存根
initialize();
}
public ItemManagerFrame(String arg0) throws HeadlessException {
super(arg0);
// TODO 自動(dòng)生成構(gòu)造函數(shù)存根
initialize();
}
public ItemManagerFrame(String arg0, GraphicsConfiguration arg1) {
super(arg0, arg1);
// TODO 自動(dòng)生成構(gòu)造函數(shù)存根
initialize();
}
/**
* This method initializes jTabbedPane
*
* @return javax.swing.JTabbedPane
*/
private JTabbedPane getJTabbedPane() {
if (jTabbedPane == null) {
jTabbedPane = new JTabbedPane();
jTabbedPane.addTab("添 加", null, getJPanel(), null);
jTabbedPane.addTab("更 新", null, getJPanel1(), null);
}
return jTabbedPane;
}
/**
* This method initializes jPanel
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel() {
if (jPanel == null) {
GridLayout gridLayout = new GridLayout();
gridLayout.setRows(6);
gridLayout.setHgap(3);
gridLayout.setVgap(4);
gridLayout.setColumns(1);
jPanel = new JPanel();
jPanel.setLayout(gridLayout);
jPanel.add(getJPanel2(), null);
jPanel.add(getJPanel3(), null);
jPanel.add(getJPanel4(), null);
jPanel.add(getJPanel5(), null);
jPanel.add(getJPanel6(), null);
jPanel.add(getJPanel7(), null);
}
return jPanel;
}
/**
* This method initializes jPanel1
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel1() {
if (jPanel1 == null) {
jPanel1 = new JPanel();
jPanel1.setLayout(new BorderLayout());
jPanel1.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
}
return jPanel1;
}
/**
* This method initializes jScrollPane
*
* @return javax.swing.JScrollPane
*/
private JScrollPane getJScrollPane() {
if (jScrollPane == null) {
jScrollPane = new JScrollPane();
jScrollPane.setViewportView(getJTable());
}
return jScrollPane;
}
/**
* This method initializes jTable
*
* @return javax.swing.JTable
*/
private JTable getJTable() {
if (jTable == null) {
String columnsName[] = {"序號", "題目", "標(biāo)準(zhǔn)答案", "難度", "分?jǐn)?shù)", "答題時(shí)間", "科目"};
jTable = new JTable();
}
return jTable;
}
/**
* This method initializes jPanel2
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel2() {
if (jPanel2 == null) {
jLabel = new JLabel();
jLabel.setText("題 型:");
jLabel.setFont(new java.awt.Font("宋體", java.awt.Font.PLAIN, 15));
jLabel.setPreferredSize(new java.awt.Dimension(70,40));
jPanel2 = new JPanel();
jPanel2.add(jLabel, null);
jPanel2.add(getJComboBox(), null);
}
return jPanel2;
}
/**
* This method initializes jPanel3
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel3() {
if (jPanel3 == null) {
jLabel1 = new JLabel();
jLabel1.setText("題目:");
jLabel1.setFont(new java.awt.Font("宋體", java.awt.Font.PLAIN, 15));
jLabel1.setPreferredSize(new java.awt.Dimension(50,40));
jPanel3 = new JPanel();
jPanel3.setLayout(new FlowLayout());
jPanel3.add(jLabel1, null);
jPanel3.add(getJTextField(), null);
}
return jPanel3;
}
/**
* This method initializes jPanel4
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel4() {
if (jPanel4 == null) {
jPanel4 = new JPanel();
jPanel4.add(getJRadioButton(), null);
jPanel4.add(getJTextField1(), null);
jPanel4.add(getJRadioButton1(), null);
jPanel4.add(getJTextField2(), null);
}
return jPanel4;
}
/**
* This method initializes jPanel5
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel5() {
if (jPanel5 == null) {
jPanel5 = new JPanel();
jPanel5.add(getJRadioButton2(), null);
jPanel5.add(getJTextField3(), null);
jPanel5.add(getJRadioButton3(), null);
jPanel5.add(getJTextField4(), null);
}
return jPanel5;
}
/**
* This method initializes jPanel6
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel6() {
if (jPanel6 == null) {
jLabel5 = new JLabel();
jLabel5.setText("標(biāo)準(zhǔn)答案: ");
jLabel4 = new JLabel();
jLabel4.setText("答題時(shí)間:");
FlowLayout flowLayout = new FlowLayout();
flowLayout.setHgap(10);
flowLayout.setVgap(12);
jLabel3 = new JLabel();
jLabel3.setText("分?jǐn)?shù):");
jLabel2 = new JLabel();
jLabel2.setText("難度:");
jPanel6 = new JPanel();
jPanel6.setLayout(flowLayout);
jPanel6.add(jLabel5, null);
jPanel6.add(getJTextField5(), null);
jPanel6.add(jLabel2, null);
jPanel6.add(getJComboBox1(), null);
jPanel6.add(jLabel3, null);
jPanel6.add(getJSpinner(), null);
jPanel6.add(jLabel4, null);
jPanel6.add(getJSpinner1(), null);
}
return jPanel6;
}
/**
* This method initializes jPanel7
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel7() {
if (jPanel7 == null) {
FlowLayout flowLayout1 = new FlowLayout();
flowLayout1.setVgap(10);
jPanel7 = new JPanel();
jPanel7.setLayout(flowLayout1);
jPanel7.add(getJButton(), null);
}
return jPanel7;
}
/**
* This method initializes jComboBox
*
* @return javax.swing.JComboBox
*/
private JComboBox getJComboBox() {
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -