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

📄 exitframe.java~2~

📁 俄罗斯方块游戏,大学时写的,支持单机及点对点网络对战!同时我还在里面加入了使用技能的功能!不过有一个缺点,呵呵好象代码写的不够严谨,所以现在性能很低,我一直也没有优化它!
💻 JAVA~2~
字号:
package ct;import javax.swing.*;import java.awt.*;import com.borland.jbcl.layout.*;import java.awt.event.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2006</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class exitFrame extends JFrame {  JLabel jLabel1 = new JLabel();  XYLayout xYLayout1 = new XYLayout();  JButton jButton1 = new JButton();  JButton jButton2 = new JButton();  Frame1 m_tFrame;  public exitFrame(Frame1 tFrame) {    m_tFrame=tFrame;    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  private void jbInit() throws Exception {    jLabel1.setFont(new java.awt.Font("Dialog", 0, 16));    jLabel1.setForeground(Color.red);    jLabel1.setText("你确定要退出游戏么??");    this.getContentPane().setLayout(xYLayout1);    jButton1.setFont(new java.awt.Font("Dialog", 0, 14));    jButton1.setText("是");    jButton1.addActionListener(new exitFrame_jButton1_actionAdapter(this));    jButton2.setFont(new java.awt.Font("Dialog", 0, 14));    jButton2.setText("否");    jButton2.addActionListener(new exitFrame_jButton2_actionAdapter(this));    this.getContentPane().add(jLabel1,     new XYConstraints(10, 10, 200, 30));    this.getContentPane().add(jButton1,       new XYConstraints(20, 60, 70, 30));    this.getContentPane().add(jButton2,        new XYConstraints(100, 60, 70, 30));  }  void jButton1_actionPerformed(ActionEvent e) {    m_tFrame.dispose();    this.dispose();  }  void jButton2_actionPerformed(ActionEvent e) {   this.dispose();  }}class exitFrame_jButton1_actionAdapter implements java.awt.event.ActionListener {  exitFrame adaptee;  exitFrame_jButton1_actionAdapter(exitFrame adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton1_actionPerformed(e);  }}class exitFrame_jButton2_actionAdapter implements java.awt.event.ActionListener {  exitFrame adaptee;  exitFrame_jButton2_actionAdapter(exitFrame adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton2_actionPerformed(e);  }}

⌨️ 快捷键说明

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