2 spinners that can't "cross their values" in Java Swing.
Hello, I have a problem regarding 2 Spinner that are meant to not "cross their values" (Spinner A's value can't go any higher than spinner's B value, and spinner's B value can't go lower than spinner's A value). Here's my code for those 2 spinners.
The main problem is that even thought the error pops up the value is still being changed. Let's say my spinner A value is 10 and B is 11. I change the value A to 11.5 than click one more time to increase, error shows up and after i close the dialog the value still increases. I tried to delete and add eventListeners but for some reason i couldn't get it to work.
4 Replies
⌛ This post has been reserved for your question.
Hey @hemoglobina! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
I also tried to "cheese it" with just decreasing or increasing value's if they are too low or too high at the end of the functions but changing the value inside this function, call's the function again because the state of the spinner has been changed, thus creating recursion i think.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.Post Closed
This post has been closed by <@292647013240143873>.