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

📄 gameoverd.java~3~

📁 JBuilder实现的具有单机
💻 JAVA~3~
字号:
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 Myscore,int R) {    super(frame, title, modal);    Myscore=Myscore;    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.jTextField1.setText(String.valueOf(Rivalscore));    this.setSize(250,150);    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(60, 42, 70, 22));    jLabel2.setFont(new java.awt.Font("Dialog", 0, 13));    jLabel2.setText("对手的分数:");    jLabel2.setBounds(new Rectangle(54, 80, 69, 24));    jTextField1.setText("");    jTextField1.setBounds(new Rectangle(144, 41, 75, 26));    jTextField2.setBounds(new Rectangle(143, 79, 76, 26));    jButton1.setBounds(new Rectangle(97, 128, 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(jTextField1, null);    panel1.add(jTextField2, null);    panel1.add(jLabel2, null);    panel1.add(jLabel1, 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 + -