Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HELP: Spin Control in Java

syed fazal faheem
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have got a spin control using this code:
JList list_hour = new JList(new Object[]{"1","2","3","4","5","6","7","8","9","10","11","12"});
panel.add(new JLabel(" hr : "));
panel.add(new JScrollPane(list_hour));
but i dont get the full functionality of spin control.
If i type a number say "5" , then number 5 should be selected on the list.
I know that this can be done by adding a key listener.
I want to know whether there is any other way.
Please give me a sample code if possible.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic