⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 icancount.java

📁 书籍"Java_面向事件编程"的附带光盘代码
💻 JAVA
字号:
import objectdraw.*;import java.awt.*;    // A program to count as high as you can click.public class ICanCount extends WindowController {        // location where count should be displayed    private static final Location COUNT_POS = new Location( 100, 100);    private int theCount = 1;   // how high we have counted    private Text countDisplay;  // current screen display of count        // Create the Text to display the current count    public void begin() {        countDisplay = new Text( theCount, COUNT_POS, canvas );    }        // Increase the count with each click    public void onMouseClick(Location point) {        theCount = theCount + 1;        countDisplay.setText( theCount );    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -