Results 1 to 2 of 2
  1. #1
    darius_dada is offline Member
    Join Date
    Dec 2010
    Posts
    1
    Rep Power
    0

    Default How to update in real time

    Hello,

    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.

    Any ideas?

  2. #2
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    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.

Similar Threads

  1. Has Some one done this before...(Real Time Data Server)
    By bonjovi4u in forum Java Servlet
    Replies: 0
    Last Post: 04-14-2010, 05:49 AM
  2. Real time task scheduling
    By coder_ in forum New To Java
    Replies: 0
    Last Post: 06-25-2009, 03:26 PM
  3. real-time validation
    By atomz4peace in forum Eclipse
    Replies: 0
    Last Post: 01-06-2009, 07:31 PM
  4. how get real-time output
    By tOpach in forum New To Java
    Replies: 5
    Last Post: 12-17-2008, 08:41 PM
  5. Replies: 0
    Last Post: 08-13-2008, 10:46 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •