fallingsnow.java
来自「书籍"Java_面向事件编程"的附带光盘代码」· Java 代码 · 共 28 行
JAVA
28 行
import java.awt.Image;import objectdraw.DrawingCanvas;import objectdraw.VisibleImage;// FallingSnow class modified to extend FallingObjectpublic class FallingSnow extends FallingObject { // initialize the instance variables and start the active object public FallingSnow( DrawingCanvas canvas, Image aSnowPic, double x, double aSpeed, int aScreenHeight) { // first, call the constructor of the FallingObject class super(aScreenHeight, aSpeed); // create our snowflake, but use the instance variable given in // the FallingObject instead object = new VisibleImage(aSnowPic, 0, 0, canvas); object.move(x, -object.getHeight()); start(); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?