[3617] in java-interest

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

writing code that works for applications AND applets

daemon@ATHENA.MIT.EDU (James E. Kittock)
Sat Nov 18 01:58:08 1995

From: "James E. Kittock" <kittock@interval.com>
Date: Fri, 17 Nov 1995 11:49:29 -0700
In-Reply-To: owner-java-interest-digest@java.sun.com
        "java-interest-digest V1 #264" (Nov 15,  8:12am)
To: java-interest@java.sun.com

Hi,

I'm just curious what needs to be done to write a program
that will work as both an application and an applet.

I currently see two options:

1. have the "main" class be a subtype of the class java.applet.Applet
and add a "main" method that does a new and then calls init()
and start()

2. have the main functionality hidden and have two front-end
classes, one for running the program as an applet and one for 
running the program as an application.

The latter seems like it would be more complicated, but the
first means that all my programs will be subclasses of applet--
is that going to be a problem in the long run?

Thanks,
--james

-- 

James E. Kittock --- Interval Research Corporation
1801-C Page Mill Road, Palo Alto, California 94304
kittock@interval.com                 (415)842-6185
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

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