jannetoolbartest.java
来自「java编程的一些Applets例子。值得深入研究一下。」· Java 代码 · 共 46 行
JAVA
46 行
/**
* Simple applet to test JanneToolbar class
*/
import java.awt.*;
import java.awt.image.*;
import java.applet.Applet;
public class JanneToolbarTest extends Applet {
JanneToolbar toolbar;
public void init() {
// test setting of background
setBackground(new Color(0xEED5B7));
// get the images
Image constr = getImage(getDocumentBase(), "images/construction.gif");
Image newi = getImage(getDocumentBase(), "images/new.gif");
Image info = getImage(getDocumentBase(), "images/info.gif");
Image warning = getImage(getDocumentBase(), "images/warning.gif");
Image caution = getImage(getDocumentBase(), "images/caution.gif");
// create toolbar panel
toolbar = new JanneToolbar(true, 4, true);
toolbar.addButton(constr, "constr");
toolbar.addButton(info, "info");
toolbar.addButton(newi, "new");
toolbar.addButton(warning, "warning");
toolbar.addButton(caution, "caution");
add(toolbar);
}
/**
* Simple action to wite selected button to stdout
*/
public boolean action(Event evt, Object arg) {
if (evt.target instanceof JanneButton) {
System.out.println("Button selected: " + (String)arg);
}
return true;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?