⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 score_dialog.java

📁 包含了7个java经典案例
💻 JAVA
字号:
package student;import java.awt.*;import javax.swing.*;import com.borland.jbcl.layout.*;import java.awt.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Score_Dialog extends JDialog {  JPanel panel1 = new JPanel();  JButton jButton1 = new JButton();  JButton jButton2 = new JButton();  JLabel jLabel1 = new JLabel();  JLabel jLabel2 = new JLabel();  JButton jButton4 = new JButton();  GridBagLayout gridBagLayout1 = new GridBagLayout();  public Score_Dialog(Frame frame, String title, boolean modal) {    super(frame, title, modal);    try {      jbInit();      pack();    }    catch(Exception ex) {      ex.printStackTrace();    }  }  public Score_Dialog() {    this(null, "", false);  }  private void jbInit() throws Exception {    panel1.setLayout(gridBagLayout1);    jButton1.setFont(new java.awt.Font("DialogInput", 0, 12));    jButton1.setText("成绩录入");    jButton1.addActionListener(new Score_Dialog_jButton1_actionAdapter(this));    jButton2.setText("成绩查询");    jButton2.addActionListener(new Score_Dialog_jButton2_actionAdapter(this));    jButton2.setFont(new java.awt.Font("DialogInput", 0, 12));    jLabel1.setFont(new java.awt.Font("DialogInput", 0, 12));    jLabel1.setText("录入学生成绩,使用前需要设置考试信息");    jLabel2.setText("查询学生成绩,使用前需录入学生成绩");    jLabel2.setFont(new java.awt.Font("DialogInput", 0, 12));    jButton4.setFont(new java.awt.Font("DialogInput", 0, 12));    jButton4.setAlignmentY((float) 0.5);    jButton4.setText("返回");    jButton4.addActionListener(new Score_Dialog_jButton4_actionAdapter(this));    this.setResizable(false);    this.setTitle("成绩管理");    getContentPane().add(panel1);    panel1.add(jLabel2,  new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(13, 21, 0, 20), 21, 20));    panel1.add(jButton1,  new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0            ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(41, 39, 7, 0), 13, 0));    panel1.add(jLabel1,  new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(41, 20, 0, 20), 9, 20));    panel1.add(jButton2,  new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0            ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(17, 39, 6, 0), 13, 0));    panel1.add(jButton4,  new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0            ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(19, 19, 16, 163), 26, 0));  }  void jButton4_actionPerformed(ActionEvent e) {    this.dispose();  }  void jButton1_actionPerformed(ActionEvent e) {    Score_Input_Dialog dlg = new Score_Input_Dialog();    Dimension dlgSize = dlg.getPreferredSize();    Dimension frmSize = getSize();    Point loc = getLocation();    dlg.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x,                    (frmSize.height - dlgSize.height) / 2 + loc.y);    dlg.setModal(true);    dlg.pack();    dlg.show();  }  void jButton2_actionPerformed(ActionEvent e) {    Score_Query_Dialog  dlg = new Score_Query_Dialog();    Dimension dlgSize = dlg.getPreferredSize();    Dimension frmSize = getSize();    Point loc = getLocation();    dlg.setLocation( (frmSize.width - dlgSize.width) / 2 + loc.x,                    (frmSize.height - dlgSize.height) / 2 + loc.y);    dlg.setModal(true);    dlg.pack();    dlg.show();  }}class Score_Dialog_jButton4_actionAdapter implements java.awt.event.ActionListener {  Score_Dialog adaptee;  Score_Dialog_jButton4_actionAdapter(Score_Dialog adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton4_actionPerformed(e);  }}class Score_Dialog_jButton1_actionAdapter implements java.awt.event.ActionListener {  Score_Dialog adaptee;  Score_Dialog_jButton1_actionAdapter(Score_Dialog adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton1_actionPerformed(e);  }}class Score_Dialog_jButton2_actionAdapter implements java.awt.event.ActionListener {  Score_Dialog adaptee;  Score_Dialog_jButton2_actionAdapter(Score_Dialog adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton2_actionPerformed(e);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -