multithreading - java swing getting a value from a JTextField from a different thread -


i know if need change jtextfield value different thread need use swingutilities.invokelater() call. if need value different thread, can use textfield.gettext() or need use sort of invokelater call? thanks.

even simple gettext() should called event dispatch thread.

if you're in thread, can use invokeandwait:

final string[] textholder = { null };  eventqueue.invokeandwait(new runnable() {     @override     public void run() {         textholder[0] = sometextfield.gettext();     } });  string text = textholder[0]; 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -