[lug] browser button events to Java

Ferdinand P. Schmid fschmid at archenergy.com
Sat Oct 28 12:14:00 MDT 2000

rm at mamma.varadinet.de wrote:

> On Fri, Oct 27, 2000 at 05:44:42PM -0600, Ferdinand P. Schmid wrote:
> >
> > One thing you could investigate - if your hosting environment supports
> > servlets is storing a state serverside.  Then your applet could receive that
> > information from the server.  A long detour - but possible.
> Hmm, don't see how you could get an event to the server ...

I don't know how you read the back button event into JavaScript inside the current
browser window - that was presented as possible in the previous message.  Once
JavaScript code understands it you can invoke a servlet and set a state on the
server.  So no event piping to the server.

> > JavaScript is generally fairly broken - every browser interprets it
> > differently.  Same is true for applets if you use the browser's own JRE.  So
> > I would test your code at least in Netscape and IE.
> >
> > Ferdinand
> >
> > Michael Wegener wrote:
> >
> > > Hello everyone,
> > >
> > > We're trying to build an applet that gets events from the browser's
> > > back/forward buttons, and are having some difficulty. There is a way to
> > > interface JavaScript to Java, but requires that the active frame contain
> > > the JavaScript, and since our applet occupies another frame, we seem
> > > stuck. Has anybody done this or run across a viable method before?
> I'm not following the 'Java in the browser' development lately but
> as far as i know there is no way to fiddle with the browsers event
> loop from within the JVM (this would be a pretty big security problem
> anyway). It might be possible to use JavaScript/Java solutions on
> some browsers but i see several problems:
>  - If your applet is on a page that the user is a bout to leave
>    the applet might (!) get unloaded and garbage collected. Calling
>    a method of a garbage collected object might give you anything from
>    a warning to a browser crash.

More information about the LUG mailing list