📄 driver.java
字号:
/** Author: David D. Riley * Date: Jan, 2005 * Die Class Driver (Figure 7.33) */import java.awt.Color;public class Driver extends ThreeButtons { private ThreeButtonFrame window; private Die die; /** post: A window is displayed * and a shadowed die is centered in the window */ public Driver() { Rectangle theDieRect; window = new ThreeButtonFrame("Die Driver"); window.setLayout(null); window.setBackground(Color.darkGray); die = new Die(); theDieRect = die.getDieRect(); theDieRect.setLocation(280, 230); window.add(theDieRect, 0); window.repaint(); } /** post: die.spotCount() == die.spotCount()@pre + 1 */ public void leftAction() { die.setSpotCount( die.spotCount()+1 ); } /** post: the color of die is set to blue */ public void midAction() { die.setDieColor(Color.blue); } /** post: the color of die is set to white */ public void rightAction() { die.setDieColor(Color.white); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -