Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JButton disable issue

843806May 24 2007 — edited May 25 2007
I have a small swing app, which have couple of buttons. One of the button involves a five minute processing. During this time, I have disabled the button and removed the action Listener. Even though the button remains faded during the process, If the user clicks on the button ( while remaining faded) , the proces starts all over again, after the end of the current process.



button.removeActionListerner(listener)
button.setEnabled(false)
paint(getGraphics())
processData()
button.setEnabled(true)
button.addActionListener(listener)
paint(getGraphics())

Any ideas ? Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 22 2007
Added on May 24 2007
20 comments
1,434 views