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 / General / May 2006

Tip: Looking for answers? Try searching our database.

Swing Dialogs and Remote Asynchronous responses ?

Thread view: 
swebb99@gmail.com - 25 May 2006 14:30 GMT
Hi,

I've done a fair bit with swing and whenever there is some heavy
backend work I make use of swingworker to help me out. However I am
working on a system at the moment where the result of pressing ok in a
Jframe results in a message being sent to a remote box and the
confirmation result comes back aysnchronously via another message. I
want to display success or fail via a dialogue but while waiting stop
the use from being about to use the GUI and also popup a busy cursor.
Also if after a specified time the response message doesn't appear
display fail in the dialog.

Anybody come across this problem before, have any tips, links ?????

Thanks in advance

Steve
Vova Reznik - 25 May 2006 14:43 GMT
> Hi,
>
[quoted text clipped - 13 lines]
>
> Steve

You may cover your JFrame with glass pane
(see JFrame#setGlassPane(Component))
with any cursor and in the same time start
swing Timer with delay you want. Timer will set
glass pane invisible after "specified time".
Don't forget to add to your glass pane all empty mouse and key listener
to block any user interaction.
swebb99@gmail.com - 25 May 2006 17:04 GMT
Thanks for that Vova that would seem to work for what I want the only
thing I would have to add is a mechanism for associating the response
coming back with the GUI component awaiting the response.

Cheers

Steve
Vova Reznik - 25 May 2006 17:13 GMT
> Thanks for that Vova that would seem to work for what I want the only
> thing I would have to add is a mechanism for associating the response
[quoted text clipped - 3 lines]
>
> Steve

Simple call back function. You may use delegate
in SwingWorker#finished().


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.