简体   繁体   中英

Unable to modify or edit JFrame fields after clicking on a button

I have a JFrame with three text fields, two combo boxes and two Jbuttons. The coding is written in Java. One button is to start the execution of the automation script and another button is to abort the execution.

But after clicking on Start Execution button, I am unable to click on the second button and unable to edit other fields like text fields, combo boxes in the JFrame also.

As this is my project related I cannot post my code here. I apologise for that. I hope you can understand the logic or concept behind my problem. I have done a lot of search in internet but still no progress.

Please help me with this. I am using action listener behind the two Jbuttons.

The Event Dispaching Thread (EDT) should only and only do graphic related work. Any other work should be done in another thread (see SwingWorker ).

Every event generated by swing, will run in the EDT, this includes actionPerformed()

That is happen because of the code implement you in the first button is continuously running , use java thread to do that stuff in the first button code. then that will be works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM