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

JSpinners revisited

Matt Fyffe
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've added JSpinners to my program and they look beautiful. I used JSpinnerNumberModel to display the value and so it shows an int between 0 and 10. My problem of course as there is always a problem when I make a new topic, is reading the number on the JSpinner when it changes.
In a previous topic, someone suggested using the command:
int i = ((Integer)stats[x].getValue()).intValue();
the value this reads is unknown to me, IF it reads a value as when I create a JOptionPane displaying this value, the JOptionPane isn't created. I tried using .getInt() rather than .intValue() as someone else suggested but I received an error stating cannot resolve symbol.
How is it that I can find out the value? And also, how can I set it's value? I assume I will have the same problem converting an int to an object as I do an object to an int.
Thanks. and PLEASE help me... these things are driving me nuts lol.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic