home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 1.2 KB | 46 lines |
-
- /**
- * 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;
- }
-
- }
-
-