Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
Hmmm, should I open up a dedicated thread for refreshing the main information panel?
Jacky Luk
Ranch Hand
Posts: 634
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I've got a main information panel displaying all the sales related figures.
I wonder is it a good idea to open up a separate
thread
to refresh
this panel every now and again. Or a timer is enough?
Thanks
Jack
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
posted 10 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
Isn't it possible to give your model listeners that get fired when the sales figures change?
public interface UpdateListener { public void update(UpdateEvent event); }
public final class SalesFigures { public void addUpdateListener(UpdateListener listener) { ... } }
final class SalesPanel extends JPanel { private void init() { sales.addUpdateListener(new UpdateListener() { @Override public void update(UpdateEvent event) { repaint(); } }); } }
Jacky Luk
Ranch Hand
Posts: 634
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
How would I define such an UpdateEvent and Listener?
Thanks
Jack
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Waiting screen - how to ?
A Question on Applet Audioclips
My Choices
How can I get a button to open another existing panel?
applet and JDialog
More...