I am new to Java programming, and I want to know how a program can invoke a process based upon time? For example, an alarm clock. How should the alarm be rung at a specific time?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A Timer object could work well for this, either java.util.Timer if general Java or javax.swing.Timer if a Swing GUI. For details on how to use either of these, I invite you to check out their API’s (links in this answer). Also Swing Timer has a decent tutorial if you are going to go that route.