?? showpanel.java
字號:
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
@SuppressWarnings("serial")
public class ShowPanel extends JPanel{
private JButton level1;
private JButton level2;
private JButton level3;
private JLabel timeShow;
private JLabel leftLei;
private Saolei saolei;
ShowPanel(Saolei saolei){
this.saolei=saolei;
level1=new JButton("easy");
level2=new JButton("normal");
level3=new JButton("hard");
timeShow=new JLabel();
leftLei=new JLabel();
level1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
ShowPanel.this.saolei.gameStart(10,10);
}
});
level2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
ShowPanel.this.saolei.gameStart(40,16);
}
});
level3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
ShowPanel.this.saolei.gameStart(100,21);
}
});
this.add(level1);
this.add(level2);
this.add(level3);
this.add(timeShow);
this.add(leftLei);
}
public void setTime(int time){
this.timeShow.setText("time:"+time+" ");
}
public void setLei(int lei){
this.leftLei.setText("mine:"+lei+" ");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -