📄 jannetoolbartest.java
字号:
/**
* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -