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

📄 dialog4.java

📁 俄罗斯方块游戏,大学时写的,支持单机及点对点网络对战!同时我还在里面加入了使用技能的功能!不过有一个缺点,呵呵好象代码写的不够严谨,所以现在性能很低,我一直也没有优化它!
💻 JAVA
字号:
package ct;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) 2006</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Dialog4 extends JDialog {  JPanel jPanel1 = new JPanel();  JTextField jTextField1 = new JTextField();  XYLayout xYLayout1 = new XYLayout();  JButton jButton1 = new JButton();  JButton jButton2 = new JButton();  JButton jButton3 = new JButton();  JTextArea jTextArea1 = new JTextArea();  public Dialog4(Frame frame, String title, boolean modal) {    super(frame, title, modal);    try {      jbInit();      pack();    }    catch(Exception ex) {      ex.printStackTrace();    }  }  public Dialog4() {    this(null, "", false);  }  private void jbInit() throws Exception {    jTextField1.setText("头像");    jPanel1.setLayout(xYLayout1);    jButton1.setFont(new java.awt.Font("Dialog", 0, 15));    jButton1.setText("单机娱乐");    jButton1.addActionListener(new Dialog4_jButton1_actionAdapter(this));    jButton2.setFont(new java.awt.Font("Dialog", 0, 15));    jButton2.setText("双人对战");    jButton2.addActionListener(new Dialog4_jButton2_actionAdapter(this));    jButton3.setFont(new java.awt.Font("Dialog", 0, 15));    jButton3.setText("游戏设置");    jButton3.addActionListener(new Dialog4_jButton3_actionAdapter(this));    jTextArea1.setText("人物信息");    this.getContentPane().add(jPanel1, BorderLayout.CENTER);    jPanel1.add(jTextArea1, new XYConstraints(176, 25, 185, 133));    jPanel1.add(jTextField1, new XYConstraints(42, 42, 96, 88));    jPanel1.add(jButton2, new XYConstraints(151, 205, 113, 45));    jPanel1.add(jButton3,  new XYConstraints(287, 204, 97, 43));    jPanel1.add(jButton1, new XYConstraints(29, 204, 105, 47));  }  void jButton2_actionPerformed(ActionEvent e) {    Dialog4 D=new Dialog4();        D.show(false);        Dialog3 F=new Dialog3();        F.setLocation(350,250);      F.show(true);     this.dispose();  }  void jButton3_actionPerformed(ActionEvent e) {    Dialog4 D=new Dialog4();        D.show(false);        Dialog5 F=new Dialog5();        F.setLocation(350,250);      F.show(true);     this.dispose();  }  void jButton1_actionPerformed(ActionEvent e) {    Dialog4 D=new Dialog4();          D.show(false);          Frame1 F=new Frame1();          F.setLocation(100,50);          F.setResizable(false);          this.setSize(new Dimension(800, 600));        F.show(true);       this.dispose();  }}class Dialog4_jButton2_actionAdapter implements java.awt.event.ActionListener {  Dialog4 adaptee;  Dialog4_jButton2_actionAdapter(Dialog4 adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton2_actionPerformed(e);  }}class Dialog4_jButton3_actionAdapter implements java.awt.event.ActionListener {  Dialog4 adaptee;  Dialog4_jButton3_actionAdapter(Dialog4 adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton3_actionPerformed(e);  }}class Dialog4_jButton1_actionAdapter implements java.awt.event.ActionListener {  Dialog4 adaptee;  Dialog4_jButton1_actionAdapter(Dialog4 adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton1_actionPerformed(e);  }}

⌨️ 快捷键说明

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