📄 inserturscorep.java
字号:
package dialog;import java.awt.*;import java.awt.event.*;import Score;/** * Title: * Description: * Copyright: Copyright (c) 2001 * Company: * @author * @version 1.0 */public class InsertURScoreP extends Panel{ Label label1 = new Label(); Label label2 = new Label(); Label label3 = new Label(); TextField textField1 = new TextField(); TextField textField2 = new TextField(); Button button1 = new Button(); Button button2 = new Button(); //玩家的得分 int m_nScore; //对话框 Dialog m_dialog; public InsertURScoreP(int nScore,Dialog d) { m_dialog=d; m_nScore=nScore; try { jbInit(); textField2.setText(""+nScore); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { label1.setText("请输入你的名字"); label1.setBounds(new Rectangle(52, 64, 116, 18)); label2.setText("你的得分为"); label2.setBounds(new Rectangle(52, 118, 83, 18)); this.setLayout(null); label3.setForeground(Color.red); label3.setText("祝贺你!你的得分已经进入Top10的行列"); label3.setBounds(new Rectangle(49, 25, 220, 18)); textField1.setColumns(10); textField1.setBounds(new Rectangle(186, 63, 56, 22)); textField2.setColumns(10); textField2.setEditable(false); textField2.setBounds(new Rectangle(186, 120, 56, 22)); button1.setLabel("确定"); button1.setBounds(new Rectangle(59, 165, 75, 29)); button1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { button1_actionPerformed(e); } }); button2.setLabel("取消"); button2.setBounds(new Rectangle(160, 164, 75, 29)); button2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { button2_actionPerformed(e); } }); this.add(label3, null); this.add(textField1, null); this.add(label1, null); this.add(label2, null); this.add(textField2, null); this.add(button1, null); this.add(button2, null); } void button1_actionPerformed(ActionEvent e) { Score score=new Score(); score.insertNameScore(textField1.getText().trim(),m_nScore); m_dialog.dispose(); } void button2_actionPerformed(ActionEvent e) { m_dialog.dispose(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -