Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-01-2007, 08:18 PM
Member
 
Join Date: Aug 2007
Posts: 1
malakaherath is on a distinguished road
dynamically updating clock
is there a class to get the cureent time from the system and allow it to run as a clock. I mean display the time like a real clock.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-01-2007, 08:56 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,189
hardwired is on a distinguished road
For time you can try:
Code:
DateFormat df = new SimpleDateFormat("hh:mm"); Calendar calendar = Calendar.getInstance(); Date date = new Date(); System.out.printf("calendar time = %s%n date = %s%ntime = %s%n", calendar.getTime(), date, df.format(date));
For milliseconds you can use System.currentTimeMillis().
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-01-2007, 08:57 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
You can use Timer class to call a method every seconds and you can also get system time with Java. By combining these, i think you can implement what you want.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help please in digital clock jaidod Java Applets 1 04-17-2008 05:05 PM
clock class program jvasilj1 New To Java 12 02-01-2008 09:27 PM
Pogo clock problem tampacurt New To Java 0 11-17-2007 03:18 AM
Updating Graphics Greedful Java 2D 2 07-20-2007 08:12 PM
Updating into 2 tables in the DB yuchuang New To Java 2 05-12-2007 07:54 AM


All times are GMT +3. The time now is 12:02 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org