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!

Unable to Disable the JButton with an ActionEvent

843806May 8 2009 — edited May 11 2009
Hi All,

I have a JButton and i am associating actionPerformed for that as shown.
 public void actionPerformed(ActionEvent disableEvent){
  if(disableEvent.getSource()==execute){ //where execute is a JButton
    execute.setEnabled(false);
    P=Runtime.getRuntime().exec("cmd /c start temp_execute.bat ");
          }
In the above snippet when i click on execute Process is running i.e. the .bat file but i end up seeing no functionality on JButton.

Is it the problem with .bat since it is Windows Thread,so it has got high priority and because of which it is skipping
execute.setEnabled(false);
Any help appreciated.

Thanks in advance.

regards,
Viswanadh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 8 2009
Added on May 8 2009
23 comments
1,192 views