Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

modal dialogs in an applet

2 views
Skip to first unread message

zac...@sempers.com

unread,
Feb 9, 1999, 3:00:00 AM2/9/99
to
Hello,

We have a problem where the most elegant solution would be to
implement a modal dialog from within our applet while running under a
browser. In brief, a user enters an html page, and to fill in some of
the fields on that html page, we pop open a modal search window, and
then put the information into the relevant field.

The problem is, of course, that while modal dialogs behave modally
under appletviewer and hotjava, both Netscape and Microsofts's
implementations do not behave as advertised.

I'm sure that someone has spent a good six months banging their head
against a keyboard figuring this one out. Rather than reinvent the
wheel, I thought maybe some of you might be kind enough to share a
better way.

Thanks in advance for any help.

Best,

--zjs
zac...@sempers.com

Ulrich Schmidt

unread,
Feb 9, 1999, 3:00:00 AM2/9/99
to

zac...@sempers.com schrieb:

We had to deal with the same Problem. What happens is that the execution
of the code is 'modal'. However the Applet is still enabled for Events and
handles them.

What we did was somthing like this:

void launchModalDialog()
{
this.setEnabled(false); //
disable the Applet
try
{
MyDialog myDialog = new MyDialog(this, true);
myDialog.setVisible(true); //launch
the Dialog
}
catch(Exception e) // you
should do this here or
// if
the Dialog dies the Applet hangs...
{
System.err.println(e); // make
shure you see the Error
}
this.setEnabled(true); //enable
the Applet again
}

Didn't like that very much. But it worked most of the time.

Ulrich
--
ulrich.schmidt at vew-telnet.net

Reply via E-Mail without 'nospam.' :-)

Gustav Weslien

unread,
Feb 9, 1999, 3:00:00 AM2/9/99
to
If you are using the 1.1 event model, you can register a listener to your
dialog that monitors if it loses focus, and if so, reclaims it. I haven't
managed to use the regular dialog modal feature on an applet at all )=

If you want to use dialogs in an applet, you have to iterate the applets
getParent() until it is an instance of Frame, and use that as a part of your
instatiation.

Then just create a class that extends Dialog and listens for focusLost().

that should work!

Cheers,

Gustav

<zac...@sempers.com> wrote in message
news:36bfae13....@news.pacbell.net...

0 new messages