wood burning stoves 2.0*
The moose likes Java in General and the fly likes can we lock desktop.........Urgent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "can we lock desktop.........Urgent " Watch "can we lock desktop.........Urgent " New topic
Author

can we lock desktop.........Urgent

narayana murthy pedapudi
Ranch Hand

Joined: Jul 23, 2003
Posts: 42
hi,
my application is a MDI application, i have a menu and many menuitems.
for different menuitems i have different frames, when i click on one menu item i don't want user to do some other click until the JFrame is closed,
can anyone please help in this regard,
it is urgent for me.
narayana
Juan Rolando Prieur-Reza
Ranch Hand

Joined: Jun 20, 2003
Posts: 236
Originally posted by narayana murthy pedapudi:
hi,
my application is a MDI application, i have a menu and many menuitems.
for different menuitems i have different frames, when i click on one menu item i don't want user to do some other click until the JFrame is closed,
can anyone please help in this regard,
it is urgent for me.
narayana

I have dealt with this kind of problem before, although it seemed like a dirty solution. Here it is anyway:
When ever a menu listener receives an event (mouse up, etc.) it sets a state variable that is accessible to all of the listeners in your application (its a Singleton, say). Your listeners all check this state and if an event is being handled, ignore incoming events. Upon completion of servicing an event, the original unsets the flag. Careful use of the Singleton should take care of thread race conditions.
The user should be free to "click" in other applications on the desktop that are not part of your application.
I'd be interested to hear if you think this would help (or has terrible problems)


Juan Rolando Prieur-Reza, M.S., LSSBB, SCEA, SCBCD, SCWCD, SCJP/1.6, IBM OOAD, SCSA
VIJAY Yadlapati
Ranch Hand

Joined: Aug 04, 2003
Posts: 175
The Simplest way is to disable all the MenuItems before showing the Frame. And enable all of them upon disposing the Internal Frame.
 
Consider Paul's rocket mass heater.
 
subject: can we lock desktop.........Urgent