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

📄 dialog9.java

📁 俄罗斯方块游戏,大学时写的,支持单机及点对点网络对战!同时我还在里面加入了使用技能的功能!不过有一个缺点,呵呵好象代码写的不够严谨,所以现在性能很低,我一直也没有优化它!
💻 JAVA
字号:
package ct;import java.awt.*;import javax.swing.*;import com.borland.jbcl.layout.*;import java.awt.event.*;import javax.swing.border.*;///帮助public class Dialog9 extends JDialog {  JPanel panel1 = new JPanel();  JPanel jPanel1 = new JPanel();  JLabel jLabel1 = new JLabel();  XYLayout xYLayout1 = new XYLayout();  JLabel jLabel2 = new JLabel();  JLabel jLabel3 = new JLabel();  JLabel jLabel4 = new JLabel();  JLabel jLabel5 = new JLabel();  JLabel jLabel6 = new JLabel();  JLabel jLabel7 = new JLabel();  JLabel jLabel8 = new JLabel();  JButton jButton1 = new JButton();  Border border1;  Frame1 f;  BorderLayout borderLayout1 = new BorderLayout();  JLabel jLabel9 = new JLabel();  JLabel jLabel10 = new JLabel();  public Dialog9(Frame frame, String title, boolean modal) {    super(frame, title, modal);    try {      jbInit();      pack();    }    catch(Exception ex) {      ex.printStackTrace();    }  }  public Dialog9() {    this(null, "", false);  }  private void jbInit() throws Exception {    border1 = new EtchedBorder(EtchedBorder.RAISED,new Color(44, 82, 255),new Color(21, 40, 128));    panel1.setLayout(borderLayout1);    jLabel1.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel1.setForeground(Color.magenta);    jLabel1.setText("YY工作室免费为您服务帮助");    jPanel1.setLayout(xYLayout1);    jLabel2.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel2.setForeground(Color.red);    jLabel2.setText("游戏指南");    jLabel3.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel3.setForeground(Color.green);    jLabel3.setText("游戏控制键:");    jLabel4.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel4.setForeground(Color.red);    jLabel4.setText("w(控制方块变形)");    jLabel5.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel5.setForeground(Color.green);    jLabel5.setText("s(控制方块快速下落)");    jLabel6.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel6.setForeground(Color.cyan);    jLabel6.setText("a(控制方块向左)");    jLabel7.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel7.setForeground(Color.pink);    jLabel7.setText("d(控制方块向右)");    jLabel8.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel8.setForeground(Color.magenta);    jLabel8.setText("本游戏新添了聊天功能和道具的使用希望您能喜欢!");    jPanel1.setBackground(new Color(31, 58, 184));    jButton1.setBackground(new Color(31, 58, 184));    jButton1.setFont(new java.awt.Font("Dialog", 0, 15));    jButton1.setForeground(Color.orange);    jButton1.setBorder(border1);    jButton1.setFocusPainted(true);    jButton1.setText("返回");    jButton1.addActionListener(new Dialog9_jButton1_actionAdapter(this));    jLabel9.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel9.setForeground(Color.yellow);    jLabel9.setText("玩加可以按z,x,c键对对方使用道具!");    jLabel10.setFont(new java.awt.Font("Dialog", 0, 15));    jLabel10.setForeground(Color.red);    jLabel10.setText("也可以按p键暂停或q键退出");    getContentPane().add(panel1);    panel1.add(jPanel1, BorderLayout.CENTER);    jPanel1.add(jLabel1,    new XYConstraints(96, 4, 194, 44));    jPanel1.add(jLabel2,  new XYConstraints(147, 39, 105, 42));    jPanel1.add(jLabel3,   new XYConstraints(18, 77, 110, 38));    jPanel1.add(jLabel4,   new XYConstraints(20, 127, 121, 30));    jPanel1.add(jLabel5,     new XYConstraints(199, 126, 150, 38));    jPanel1.add(jLabel6,  new XYConstraints(18, 176, 128, 35));    jPanel1.add(jLabel7,   new XYConstraints(199, 175, 145, 41));    jPanel1.add(jLabel8,          new XYConstraints(27, 214, 393, 46));    jPanel1.add(jLabel9,      new XYConstraints(27, 265, 259, 33));    jPanel1.add(jLabel10,       new XYConstraints(27, 308, 295, 32));    jPanel1.add(jButton1,  new XYConstraints(127, 347, 63, 29));  }  void jButton1_actionPerformed(ActionEvent e) {    f.setEnabled(true);        this.dispose();  }}class Dialog9_jButton1_actionAdapter implements java.awt.event.ActionListener {  Dialog9 adaptee;  Dialog9_jButton1_actionAdapter(Dialog9 adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton1_actionPerformed(e);  }}

⌨️ 快捷键说明

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