📄 reportpanel.java
字号:
package tetrics;
import java.awt.*;
import java.awt.event.*;
import java.awt.*;
/**
* Title:
* Description:
* Copyright: Copyright (c) 2001
* Company:
* @author
* @version 1.0
*/
public class ReportPanel extends Panel {
Button button1 = new Button();
Panel panel1 = new Panel();
Dialog m_dialog;
public ReportPanel(Dialog d) {
m_dialog=d;
try {
jbInit();
myInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void myInit() throws Exception{
TextField[] m_textScore=new TextField[10];
TextField[] m_textName=new TextField[10];
Score score=new Score();
int[] nScore=score.getScore();
String[] sName=score.getName();
for(int i=0;i<sName.length;i++)
{
Panel p=new Panel();
System.out.println(sName[i].trim());
m_textName[i]=new TextField(sName[i],10);
m_textScore[i]=new TextField(""+nScore[i],8);
m_textName[i].setEditable(false);
m_textScore[i].setEditable(false);
Label l1=new Label("玩家");
Label l2=new Label("分数");
p.add(l1);
p.add(m_textName[i]);
p.add(l2);
p.add(m_textScore[i]);
panel1.add(p);
}
}
private void jbInit() throws Exception {
button1.setLabel("确定");
button1.setBounds(new Rectangle(285, 234, 75, 29));
button1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
button1_actionPerformed(e);
}
});
this.setLayout(null);
panel1.setBounds(new Rectangle(24, 16, 596, 207));
this.add(panel1, null);
this.add(button1, null);
this.setSize(650,300);
}
void button1_actionPerformed(ActionEvent e) {
m_dialog.dispose();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -