I have a GUI with two JSpinner's and a Spinner Model attached to each of them. When changing one value, the other changes. I suspect this is because I'm using the same model. This is obviously not what I intend to do, is there a better way than creating another Spinner Model with the same value's?

Recommended Answers

All 5 Replies

If you want two independent spinners then why are you worrying about giving each its own model?

Because when I give them the same model, when I increase one, it increases the other. Same with decreasing them, or manually editing the value.

I'm confused.
If you want them to change together use one model.
If you wnt them to change independently use two models.
What's the problem?

It just doesn't make sense to me why using one model would make it so that both of them change together. To me, it would be better to do that with code, which is very simple, then create two seperate models with the same values.

It's because the model contains the state info for the spinner.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.