wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Please help: how to use tab to move from hours section to minutes section in format 'hours:minutes'. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Please help: how to use tab to move from hours section to minutes section in format Watch "Please help: how to use tab to move from hours section to minutes section in format New topic
Author

Please help: how to use tab to move from hours section to minutes section in format 'hours:minutes'.

Keshav Khedkar
Greenhorn

Joined: Jun 23, 2007
Posts: 4
Hi All,
I am stuck with a problem regarding jspinner.
I am using jspinner in following code:
Date date = new Date();
SpinnerDateModel sm = new SpinnerDateModel(date, null, null, Calendar.HOUR_OF_DAY);
jsTime = new JSpinner(sm);
JSpinner.DateEditor de = new JSpinner.DateEditor(jsTime, "hh:mm");
jsTime.setEditor(de);
jsTime.getEditor().setEnabled(false);
currently If I press tab key on the above jspinner, focus get shifted to next control (not in above code). What I want is if I am in hours section and presses a tab key then it should go to minutes section. If I am in minutes section and presses a tab key, it should go to next control.
Till now I tried to get as much information as possible from net. but failed to get a solution to this.
Please help me with this.
thanks & regards,
KK.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
Please use the code button, otherwise your post is illegible.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
this is one of the ways
(needs tweaking if shift-tab is to be exact opposite i.e. comp-->minutes-->hours-->comp)

 
Consider Paul's rocket mass heater.
 
subject: Please help: how to use tab to move from hours section to minutes section in format 'hours:minutes'.