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

📄 scrollingsimple.java

📁 初期JAVA学习非常有用的资料。帮助深入了解API。特别是Applet。
💻 JAVA
字号:
/* * 1.0 code (remains the same in 1.1). */import java.applet.Applet;import java.awt.TextField;public class ScrollingSimple extends Applet {    TextField field;    public void init() {        //Create the text field and make it uneditable.        field = new TextField();        field.setEditable(false);        //Set the layout manager so that the text field will be        //as wide as possible.        setLayout(new java.awt.GridLayout(1,0));        //Add the text field to the applet.        add(field);        validate();  //this shouldn't be necessary        addItem("initializing... ");    }    public void start() {        addItem("starting... ");    }    public void stop() {        addItem("stopping... ");    }    public void destroy() {        addItem("preparing for unloading...");    }    void addItem(String newWord) {        String t = field.getText();        System.out.println(newWord);        field.setText(t + newWord);    }}

⌨️ 快捷键说明

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