Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2004

Tip: Looking for answers? Try searching our database.

Modifying a modal dialog from another dialog

Thread view: 
delraydog@gmail.com - 14 Dec 2004 15:46 GMT
I have a modal dialog with a text area and a button on it. The button
launches another dialog. This second dialog has buttons on it which
attempt to change the text area on the original dialog, however, this
dialog is 'frozen' and none of the buttons work. I know this is an
event/threading issue but I'm not sure of the proper way to design this
task. The first dialog must be modal. I tried launching the second
dialog in a separate thread but that had no effect and I think it
violates the swing thread safety design issue anyway. Any ideas?
Thanks,
Cliff.
delraydog@gmail.com
Babu Kalakrishnan - 14 Dec 2004 16:10 GMT
> I have a modal dialog with a text area and a button on it. The button
> launches another dialog. This second dialog has buttons on it which
[quoted text clipped - 4 lines]
> dialog in a separate thread but that had no effect and I think it
> violates the swing thread safety design issue anyway. Any ideas?

What is specified as the parent of the second dialog ?

BK
Cliff - 14 Dec 2004 17:22 GMT
No parent has been specified. I posted some sample code which
demonstrates this problem and it should appear online shortly.
Thanks,
Cliff.
Nigel Wade - 15 Dec 2004 10:22 GMT
> No parent has been specified. I posted some sample code which
> demonstrates this problem and it should appear online shortly.
> Thanks,
> Cliff.

Make the modal dialog the owner of the sub-dialog. The API docs for Dialog
(from which JDialog is sub-classed) describe this:

"A dialog can be either modeless (the default) or modal. A modal dialog is  
 one which blocks input to all other toplevel windows in the application,
 except for any windows created with the dialog as their owner."

i.e.
subDialog = new JDialog(modalDialog);

Signature

Nigel Wade, System Administrator, Space Plasma Physics Group,
           University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.