Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HELP: Spin Control in Java  RSS feed

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.
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!