Animesh Kumar Paul
Animesh Kumar Paul

Reputation: 2304

How to change hours, minutes, and seconds separately using a JSpinner?

Could someone please advise how I can show a time of format hh:mm:ss,msms in a JSpinner. How can I set the spinner to allow independent adjustment of the hours, minutes, and seconds?

Start_time_jSpinner = new javax.swing.JSpinner();

Upvotes: 2

Views: 975

Answers (1)

wattostudios
wattostudios

Reputation: 8774

The simplest would probably be to create 3 separate spinners, where the first one has values 0-23 (for hours) and the other 2 have values 0-59 (for minutes and seconds).

Refer to the API documentation here... http://docs.oracle.com/javase/6/docs/api/javax/swing/JSpinner.html

Or there is a tutorial here which will probably help you... http://docs.oracle.com/javase/tutorial/uiswing/components/spinner.html

You should attempt to implement your spinners, and if you still need assistance, post some code here and we'll be able to better help.

Upvotes: 4

Related Questions