Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do I need to use thread on JFrame?

Status
Not open for further replies.

wangdong

Programmer
Oct 28, 2004
202
CN
I have a program using JFrame as UI. On this JFrame there is a click button which allows the user to open a new JFrame. My problem is when the user is doing some update work on one of the JFrames (it normally takes 3~5 seconds), the rest of JFrames will be in a block mode. I think it because the number of JFrame is increasing, but there is only one main thread.

Is there any solution to this? or Do I have to implement this program into a multiple thread.

Thank you,

Dong

Chinese Java Faq Forum
 
Just be aware that if you do anything time-consuming in a separate thread, any GUI updates that process may need to do MUST be done using the Event-Dispatch thread (use either of EventQueue.invokeAndWait or EventQueue.invokeLater depending on your needs).

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top