// // MeSelector class // part of the set of documents known as Java no sugar. // Copyright (c) 1996,1997 Sunil Gupta, sunil@magnetic.demon.co.uk // placed into the public domain by the author // import java.applet.*; import java.awt.*; import MeCanvas; import Context; public class MeSelector extends Applet { //******************************************************************* // instance variables //******************************************************************* Button go_button, stop_button; MeCanvas me; //******************************************************************* // applet methods //******************************************************************* public void init() { Panel controls; Context.code_base = getCodeBase(); // -------------------------------------- // create the interface items to display // -------------------------------------- go_button = new Button("Go"); stop_button = new Button("Stop"); me = new MeCanvas(); //---add controls to a control panel.------------- controls = new Panel(); controls.setLayout( new GridLayout(2,1)); controls.add(go_button); controls.add(stop_button); //------------------and now a border layout------------ this.setLayout(new BorderLayout()); this.add("West", controls); this.add("Center", me); } public boolean action(Event event, Object o) { if (event.target == go_button) me.start(); else if (event.target == stop_button) me.stop(); return (true); } public String getAppletInfo() { return "TEST APP VERSION 2"; } }
file: /Techref/language/java/nosugar/graphics/me/code/MeSelector.java, 1KB, , updated: 1997/6/1 20:05, local time: 2024/11/17 20:16,
3.145.82.50:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/techref/language/java/nosugar/graphics/me/code/MeSelector.java"> language java nosugar graphics me code MeSelector</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.