Results 1 to 2 of 2
Thread: How to update in real time
- 12-14-2010, 04:53 PM #1Member
- Join Date
- Dec 2010
- Rep Power
How to update in real time
I have an application that fills a jlist from a mysql database.
I've implemented an updateList() function that I use for updating the list after a create or delete operation.
So here is my question:
How do I update the list in real time...meaning...if the database is modified outside the application(say the MySql Command Line Program) I want my list to update automaticaly.....without any refresh button or any stuff like that.
I was thinking of a function (or something) that runs in the background and checks the database every 5 or 10 seconds...but I have no ideea how to implement something like that.
- 12-14-2010, 10:05 PM #2
a good choice for a dynamically changing list is to use the DefaultListModel. you will find an example here. in the example the JList is updated by pressing either the add or the remove button. in your app you could instantiate a thread that reads your records every 5 or 10 seconds, looks for changes and update the jlist.
- By bonjovi4u in forum Java ServletReplies: 0Last Post: 04-14-2010, 05:49 AM
- By coder_ in forum New To JavaReplies: 0Last Post: 06-25-2009, 03:26 PM
- By atomz4peace in forum EclipseReplies: 0Last Post: 01-06-2009, 07:31 PM
- By tOpach in forum New To JavaReplies: 5Last Post: 12-17-2008, 08:41 PM
- By aneuryzma in forum New To JavaReplies: 0Last Post: 08-13-2008, 10:46 PM