A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
Swing / AWT / SWT
Author
problem using InvokeLater()
Rob Brew
Ranch Hand
Joined: Jun 23, 2011
Posts: 88
posted
Oct 21, 2011 10:22:51
0
initial problem solved, please scroll down.
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56554
14
I like...
posted
Oct 21, 2011 10:24:38
1
Rather than just replacing the post, would it not have been friendlier to post your solution?
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2946
15
I like...
posted
Oct 21, 2011 10:27:30
0
Rob Brew wrote:
solved
What was the query?
The user landing on this page would be clueless.
Mohamed Sanaulla |
My Blog
Rob Brew
Ranch Hand
Joined: Jun 23, 2011
Posts: 88
posted
Oct 21, 2011 10:36:20
0
Had a problem using InvokeLater(). Placing Swingutilities.invokeLater in place of t.start fixed it.
Thanks all.
public ServerGUI(ServerCore sc) { this.sc = sc; initComponents(); Thread t = new Thread(new UpdateData()); SwingUtilities.invokeLater(t); }
class UpdateData extends Thread { synchronized public void run() { while (true) { for (Bought b : sc.beingBought()) { bought.add(b.getName()); System.out.println(b.getName()); bought.toArray(strings); } try { sleep(1000); } catch (InterruptedException ex) { Logger.getLogger(ServerGUI.class.getName()).log(Level.SEVERE, null, ex); } } } }
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56554
14
I like...
posted
Oct 21, 2011 10:41:10
0
Rob Brew,
Your post was moved to a
new topic
.
I agree. Here's the link:
http://aspose.com/file-tools
subject: problem using InvokeLater()
Similar Threads
Ant Developer's Handbook
Some advice in a printing problem ...
Struts tag - logic:present attribute?
Visa program may aid foreign companies
Head First 2nd Edition Ch7 #14 Mock Exam P.341
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter