Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-05-2008, 02:42 PM
Member
 
Join Date: Jun 2008
Posts: 20
Rep Power: 0
Melki is on a distinguished road
Default Perform one action at a time
Dear all,

When I click a button in my Swing application then it should be made that no other actions can be performed using the mouse until that action is completed.

Please give your ideas regarding this.

Thank you.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 12-05-2008, 02:55 PM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 6,431
Rep Power: 8
Fubarable is on a distinguished road
Default
what do you mean by "no other actions can be performed using the mouse"? Do you mean that other buttons and components are not enabled until some action is complete? Can you post a small compilable program that shows an idea of what you're trying to do?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-05-2008, 03:45 PM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 6,431
Rep Power: 8
Fubarable is on a distinguished road
Default
To the original poster, cross-posting can frustrate anyone who tries to help you only to find out later that the same answer was given hours ago in a cross-posted thread. No one likes wasting their time, especially a volunteer. The polite thing to do would be to not do this, but if you feel that you absolutely must, to at least provide links in both cross-posts to each other.

Freeze the GUI on a button click process. (Swing / AWT / SWT / JFace forum at JavaRanch)
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-05-2008, 03:57 PM
Member
 
Join Date: Jun 2008
Posts: 20
Rep Power: 0
Melki is on a distinguished road
Default
I am having a GUI where i will be having four or five buttons more than that i will be having a tree also. For each buttons there will be an action called, on the same time in the tree also on selecting each node of the tree an action will be performed. So when the user clicks one of the buttons then I should not allow him to click other buttons until the action of this(clicked) button is completed. Also I should not allow him to click the nodes of the trees also.

I hope this will give you an idea.

Thank you.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 12-05-2008, 03:59 PM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 6,431
Rep Power: 8
Fubarable is on a distinguished road
Default
Since I have no idea if someone else is giving the same suggestion elsewhere in a cross-post and am not in the mood to do futile work, I'm dropping this thread. Best of luck.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 12-07-2008, 11:44 PM
Member
 
Join Date: Nov 2008
Posts: 5
Rep Power: 0
jacob6900 is on a distinguished road
Default
I am assuming you are using the MouseClicked event. Using the ActionPerformed should (depending on your jre version) keep the mouse down until the functions within its scope are complete. A hack I have used before is to create a Boolean canClick, set it to false on click, then when all functions are complete set it to true. The other buttons would check this and if false, they would not click.
__________________
Best Regards,
JacobM
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 12-08-2008, 08:29 AM
Member
 
Join Date: Jun 2008
Posts: 20
Rep Power: 0
Melki is on a distinguished road
Default
Thank you jacob it seems as a good idea, I will work on it but does java has any objects that would seperately monitor the changes in the GUI. Because if such an Object exist means then I hope it will be usefull to us in many ways.

Thank you.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
i click on it,then first time error page comes,second time click then product page co 82rathi.angara New To Java 21 08-01-2008 12:13 PM
How to perform some event to button click eva AWT / Swing 2 01-16-2008 01:27 AM
Run RCP action from outside of the Eclipse RCP leonbandas Eclipse 1 01-07-2008 08:15 AM
jsp:forward action Java Tip Java Tips 0 12-24-2007 11:04 AM
Few action in one Jbutton kubiasty New To Java 0 07-25-2007 11:19 AM


All times are GMT +2. The time now is 12:54 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org