[1913] in java-interest

home help back first fref pref prev next nref lref last post

Porting Jonathan Paynes' widget class to beta

daemon@ATHENA.MIT.EDU (Robert Lum)
Tue Sep 19 21:25:58 1995

From: Robert Lum <lum@pharaoh.sphinx.com>
To: java-interest@java.Eng.Sun.COM, hotjava-interest@java.Eng.Sun.COM
Date: Tue, 19 Sep 1995 13:39:18 -0700 (PDT)


For those who may be using Jonathan Paynes' widget class, the following 
information about porting to Java Beta release may by helpful.

1) First, remove any constructors for the class and instead replace them
   with and Init method. The class for the applet should be derived from the
   Applet class (if it was previously derived from AppComponent for example).
2) The method addNotify should be removed as it overides the definition earlier
   in the class heirachy for the Applet class. Instead, move the former 
   body of the addNotify method into the Init method. Thus, in extending the
   applet to have subcomponents which are themselves components, the nofication
   occurs in the initialisation of the class/applet. The add method still works
   in Applet class and can be used to add components in the init method for the    class one is porting.
3) The classes AppText, AppLabel, AppCheck, (or names to that effect) in JP's
   library are replaced by the corresponding classes TextField, Label and
   CheckBox in the Beta release. Generally the widget mapping is one to one 
   between JP's widgets and the Beta widgets. Care has to be take that the
   Beta widgets have different constructors.
4) Finally, the Action method that one previously used to handle events has
   to be changed to take an extra argument. Where previously one had
      public void Action(AppCheckbox at), 
   this becomes 
      public Boolean Action(Event e, Checkbox at).
   This is because Applet class has an Action method already for event handling.
5) Note that some methods where previously returned void now return boolean.
   In this case the return value should be set to true.

Hope this helps,

Robert
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post