Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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)
 
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Simplest way is to disable all the MenuItems before showing the Frame. And enable all of them upon disposing the Internal Frame.
reply
    Bookmark Topic Watch Topic
  • New Topic