📄 risingsun.java
字号:
import objectdraw.*;import java.awt.*;// A program that produces an animation of the sun rising.// The animation is driven by clicking the mouse button.// The faster the mouse is clicked, the faster the sun will rise.public class RisingSun extends WindowController{ private FilledOval sun; // Circle that represents the sun private Text instructions; // Display of instructions // Place the sun and some brief instructions on the screen public void begin() { sun = new FilledOval( 50, 150, 100, 100, canvas); instructions = new Text( "Please click the mouse repeatedly", 20, 20, canvas); } // Move the sun up a bit each time the mouse is clicked public void onMouseClick(Location point) { sun.move(0, -5); instructions.hide(); } // Move the sun back to its starting position and redisplay // the instructions public void onMouseExit(Location point){ sun.moveTo( 50, 150 ); instructions.show(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -