[geeks] javascript tutorial sought?

Jonathan C. Patschke jp at celestrion.net
Tue Aug 12 10:24:08 CDT 2008


On Tue, 12 Aug 2008, der Mouse wrote:

> Can Java applets speak to JavaScript within the same page?  (I'm
> thinking maybe JS could act as a display interface for an applet.)

I don't think the communication works in that direction.  Javascript
functions can certainly access applets (the applets' functions are
directly exposed to Javascript).  However, I don't know of anyway to get a
scripting handle from getAppletContext().

> Sounds as though maybe I really want to be asking about applets.  Are
> they supported by non-Windows things like Firefox?  (I need something to
> develop on, and this is not an important enough project to get me to
> either pay for Windows or set up a pirated Windows machine.)

Java Applets are supported by nearly GUI web browser since Netscape 2.0.
If you don't want to demand a recent Java runtime environment, look at the
java.applet.Applet class in the Java 1.1 platform reference.  If you can
demand something recent, look at javax.swing.JApplet in Java 2 v1.5.0 or
later.

> Actually, my only reason for wanting to do it as something even vaguely
> Webby is that the only other option I'm aware of is to make it a
> standalone Windows application, and even I am not crazy enough to try to
> do that without a Windows development box.  I'm sure there are plenty of
> options I'm missing; anything you'd suggest I look into?

Well, I actually enjoy Win32 programming (far, -far- more than I enjoy
actually using the abominable platform).  Even before the days of VMware
Fusion, I did my Win32 development on a Macintosh (and, before that, an
IRIX system), just keeping a Windows PC around for compilation and
testing.  You can do some limited development and testing under WINE, but
that gets a little tedious.

A standalone Java application might actually be a better fit for you,
since you're not wedded to the web browser.  That would give you the
ability to simultaneously support other platforms you might not personally
care about (MacOS, for instance).

> That's not terribly surprising; the Web browser abstraction is not a
> very good paradigm match for most applications.

It really isn't, yet we keep trying to force that peg into that particular
hole.

-- 
Jonathan Patschke | "There is more to life than increasing its speed."
Elgin, TX         |                                   --Mahatma Gandhi
USA               |



More information about the geeks mailing list