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 -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -