Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2010
    Thanked 0 Times in 0 Posts

    counting down in java


    whilst i was trying to do this program in javascript, i have been told that javascript isn't the right language to use (it needs to interact with a database, which javascript supposedly doesn't do).

    it would be for a library reservation system. this would be put on the computers with sessions from 15 minutes to 2 hours (in 15 minute chunks i.e, 15, 30, 45, 1 hour).

    this program would countdown the remaining time on their session, with pop-up messages appearing every so often.

    at the end of the session, the program will have to automatically log the user off.

    any tips would be appreciated, thanks

  2. #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,662 Times in 2,631 Posts
    Yes, this cannot be done with javascript by itself if you want to interact with a database.
    Look at the Timer: http://download.oracle.com/javase/1....til/Timer.html which includes a schedule and allows you to execute a TimerTask every x milliseconds.
    The TimerTask itself will need to be extended and overridden, and runs as a thread, so the run() must be overridden to take care of the task you want (such as a JDialog).
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


Posting Permissions

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