📄 movecubebutton.java
字号:
// Figure 8.30import java.awt.event.ActionEvent; public class MoveCubeButton extends EventButton { private Cube theCube; /** pre: d != null <br> * post: theCube == d * and getX() == x and getY() == y * and getWidth() == 100 and getHeight() == 30 */ public MoveCubeButton( int x, int y, Cube d ) { super( "MOVE" ); setBounds(x, y, 100, 30); theCube = d; } /** pre: theCube != null <br> * post: theCube.getX() == theCube.getX()@pre + 5 * and theCube.getY() = theCube.getY()@pre + 5 */ public void actionPerformed( ActionEvent e ) { theCube.setLocation( theCube.getX()+5, theCube.getY()+5 ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -