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

📄 netscorereportframe.java~2~

📁 俄罗斯方块游戏,大学时写的,支持单机及点对点网络对战!同时我还在里面加入了使用技能的功能!不过有一个缺点,呵呵好象代码写的不够严谨,所以现在性能很低,我一直也没有优化它!
💻 JAVA~2~
字号:
package ct;import javax.swing.*;import java.awt.*;import com.borland.jbcl.layout.*;import java.awt.event.*;//public class netScoreReportFrame extends JFrame {  JLabel jLabel1 = new JLabel();  XYLayout xYLayout1 = new XYLayout();  JLabel jLabel2 = new JLabel();  JLabel jLabel3 = new JLabel();  JLabel jLabel4 = new JLabel();  JButton jButton1 = new JButton();  public netScoreReportFrame() {    try {      //jLabel1.setText(name);  //    jLabel2.setText(String.valueOf(m_score));    //  jLabel3.setText(enemyname);    //  jLabel4.setText(String.valueOf(m_enemyscore));      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  private void jbInit() throws Exception {    jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));    jLabel1.setForeground(Color.magenta);    jLabel1.setText("你的分数为:");    this.getContentPane().setLayout(xYLayout1);    jLabel3.setFont(new java.awt.Font("Dialog", 0, 14));    jLabel3.setForeground(Color.red);    jLabel3.setText("对手的分数为:");    jLabel2.setFont(new java.awt.Font("Dialog", 0, 14));    jLabel2.setForeground(Color.magenta);    jLabel2.setText("");    jLabel4.setFont(new java.awt.Font("Dialog", 0, 14));    jLabel4.setForeground(Color.red);    jLabel4.setText("");    xYLayout1.setWidth(308);    xYLayout1.setHeight(172);    jButton1.setText("确定");    jButton1.addActionListener(new netScoreReportFrame_jButton1_actionAdapter(this));    this.getContentPane().add(jLabel1,      new XYConstraints(10, 10, 90, 30));    this.getContentPane().add(jLabel2,   new XYConstraints(120, 10, 100, 30));    this.getContentPane().add(jLabel3,   new XYConstraints(10, 50, 90, 30));    this.getContentPane().add(jLabel4,   new XYConstraints(120, 50, 100, 30));    this.getContentPane().add(jButton1,    new XYConstraints(70, 100, 100, 30));  }  void jButton1_actionPerformed(ActionEvent e) {    this.dispose();  }}class netScoreReportFrame_jButton1_actionAdapter implements java.awt.event.ActionListener {  netScoreReportFrame adaptee;  netScoreReportFrame_jButton1_actionAdapter(netScoreReportFrame adaptee) {    this.adaptee = adaptee;  }  public void actionPerformed(ActionEvent e) {    adaptee.jButton1_actionPerformed(e);  }}

⌨️ 快捷键说明

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