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

📄 gameoverd.java

📁 JBuilder实现的具有单机
💻 JAVA
字号:
package dialog;import java.awt.*;import javax.swing.*;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 GameOverD extends JDialog {  int Myscore;  int Rivalscore;  JPanel panel1 = new JPanel();  JLabel jLabel1 = new JLabel();  JLabel jLabel2 = new JLabel();  JTextField jTextField1 = new JTextField();  JTextField jTextField2 = new JTextField();  JButton jButton1 = new JButton();  public GameOverD(Frame frame, String title, boolean modal,int M,int R) {    super(frame, title, modal);    Myscore=M;    Rivalscore=R;    try {      jbInit();      pack();    }    catch(Exception ex) {      ex.printStackTrace();    }  }  public GameOverD(int m,int r) {    this(null, "", false,m,r);    this.jTextField1.setText(String.valueOf(Myscore));    this.jTextField2.setText(String.valueOf(Rivalscore));    this.setSize(225,200);    this.setLocation(400,300);    this.show();  }  private void jbInit() throws Exception {    panel1.setLayout(null);    jLabel1.setFont(new java.awt.Font("Dialog", 0, 13));    jLabel1.setText("你的分数:");    jLabel1.setBounds(new Rectangle(46, 33, 70, 22));    jLabel2.setFont(new java.awt.Font("Dialog", 0, 13));    jLabel2.setText("对手的分数:");    jLabel2.setBounds(new Rectangle(38, 71, 69, 24));    jTextField1.setEditable(false);    jTextField1.setText("");    jTextField1.setBounds(new Rectangle(131, 31, 75, 26));    jTextField2.setEditable(false);    jTextField2.setBounds(new Rectangle(130, 70, 76, 26));    jButton1.setBounds(new Rectangle(77, 112, 83, 25));    jButton1.setFont(new java.awt.Font("Dialog", 0, 13));    jButton1.setText("确定");    jButton1.addActionListener(new GameOverD_jButton1_actionAdapter(this));    getContentPane().add(panel1);    panel1.add(jLabel1, null);    panel1.add(jTextField1, null);    panel1.add(jLabel2, null);    panel1.add(jTextField2, null);    panel1.add(jButton1, null);  }  void jButton1_actionPerformed(ActionEvent e) {    this.dispose();  }}class GameOverD_jButton1_actionAdapter implements java.awt.event.ActionListener {  GameOverD adaptee;  GameOverD_jButton1_actionAdapter(GameOverD adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton1_actionPerformed(e);  }}

⌨️ 快捷键说明

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