Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
I will bet any money that its because you've created 2 spinners but using only one model right?
You need to create a seperate model for each JSpinner you want to make individual.
Re: A copy of a jspinner shows the same value as the original...
Nov 3, 2009 8:47 AM
(reply 7
of 13) (In reply to
#4 )
cstrieder wrote:
Ctrl+C, Ctrl+V
Oh dear I dont think thats what he ment by how did you copy them....lol
If you have created 2 Jspinners with the new keyword you also need to create 2 Spinner Models as mentioned above and psss them into the constructors of the spinners:
String [] stuff = {"Blah", "Blah2", "Blah3"};
SpinnerListModel spinnerModel1 = new SpinnerListModel(stuff); //Theres different types
SpinnerListModel spinnerModel2 = new SpinnerListModel(stuff);
JSpinner spinner1 = new JSpinner(spinnerModel1);
JSpinner spinner2 = new JSpinner(spinnerModel2);
Its not correct but it gives you an idea on how it should be done.
Re: A copy of a jspinner shows the same value as the original...
Nov 4, 2009 2:47 AM
(reply 11
of 13) (In reply to
#7 )
Sorry about my answer "Ctrl+C/Ctrl+V". In fact I did not understood what I can answer for that question..But the comments were funny...
The point is, I have two models for every spinner, one or other model is selected by a radio button for every jspinner. And I have 32 jspinner components - this gives me 64 models.