📄 herodialog.java
字号:
package mine.view;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import mine.*;
public class HeroDialog
extends JDialog {
JPanel panel1 = new JPanel();
JTextArea jTextArea1 = new JTextArea();
JButton ReRecoder = new JButton();
JButton confirm = new JButton();
GameConfigure gameconfigure = GameConfigure.getInstance();
public HeroDialog(Frame frame) {
super(frame, "扫雷英雄榜", true);
init();
this.setSize(250, 150);
this.setBounds((int)frame.getX() + 20,
(int) frame.getY() + 75, 250, 150);
}
public HeroDialog() {
}
private void init() {
panel1.setLayout(null);
jTextArea1.setBackground(UIManager.getColor("CheckBox.background"));
jTextArea1.setText(gameconfigure.getRecorderShow());
jTextArea1.setEditable(false);
jTextArea1.setBounds(new Rectangle(13, 12, 238, 59));
ReRecoder.setBounds(new Rectangle(17, 75, 93, 22));
ReRecoder.setActionCommand("jButton1");
ReRecoder.setText("重新计分");
ReRecoder.addActionListener(new HeroDialog_ReRecoder_actionAdapter(this));
confirm.setText("确定");
confirm.addActionListener(new HeroDialog_confirm_actionAdapter(this));
confirm.setActionCommand("jButton1");
confirm.setBounds(new Rectangle(121, 74, 88, 23));
getContentPane().add(panel1);
panel1.add(jTextArea1, null);
panel1.add(ReRecoder, null);
panel1.add(confirm, null);
}
void confirm_actionPerformed(ActionEvent e) {
this.dispose();
}
void ReRecoder_actionPerformed(ActionEvent e) {
gameconfigure.reRecorder();
init();
}
}
class HeroDialog_confirm_actionAdapter
implements java.awt.event.ActionListener {
HeroDialog adaptee;
HeroDialog_confirm_actionAdapter(HeroDialog adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.confirm_actionPerformed(e);
}
}
class HeroDialog_ReRecoder_actionAdapter
implements java.awt.event.ActionListener {
HeroDialog adaptee;
HeroDialog_ReRecoder_actionAdapter(HeroDialog adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.ReRecoder_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -