Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

refresh a JPanel automatically with time

 
sum prit
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir/ Madam, i am facing a problem regarding how to refresh a JPanel in a timely manner. I have four JLabel in a JPanel which get value from database. My database has a table, where i have values in a timely manner within an interval of 1 hour. now i have to refresh my JLabel values i.e refresh JPanel so that as time changes i can display the new data from the database.

Now what i needed is that my JPanel need to be get refreshed automatically with the passing of time. When a day changes my JPanel get refreshed with date and time i.e if today is 13-03-2011 then next day i.e 14-03-2011 my JPanel need to be get refreshed automatically. I don't have much idea about timers and schedule. please help me and give me some suggestion so that i can continue............ please tel me what to write in action performed() method.

Please, help me in this regard. Any help from you will highly be appreciated. Thank you in advance.
 
Darryl Burke
Bartender
Posts: 5132
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cross posted?
http://www.java-forums.org/awt-swing/40442-how-refresh-contents-jpanel.html
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Similar issue? refresh a JPanel automatically as time changes
 
Campbell Ritchie
Sheriff
Pie
Posts: 49411
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Sanaulla wrote:Similar issue? refresh a JPanel automatically as time changes
Good grief! Yes the two posts really are similar Are the two of you writing the same thing at the same time?
 
sum prit
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Sir, may be both of us are posting the same thing. But we are not same. Sir, i have found something that timers can check servers time. But how it does? can you explain me and give a little bit of idea about it......

Thank you....
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This and this will be helpful
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic