• Post Reply Bookmark Topic Watch Topic
  • New Topic

Enabling JavaFx Controls in specific order  RSS feed

John Tsioumpris
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to everybody.
I am trying to find an elegant way to enable controls in a specific order.
Lets say for example i have 10 combo boxes ...all disabled and stacked vertically.The 1st combo gets enabled by a command.
Everytime i select a value in a combo-box the next combo-box gets enabled and is ready for selection.
So if i had the comboboxes named cb1,cb2,cb3... when cb1 gets a values the cb2 gets enabled,when a value is selected in cb3 then cb4 gets enabled and so on.
The issue is i don't like the idea of naming them like cb1,cb2....and using the arithmetic value to act accordingly.
I also don't want to use the classic code of addActionListener and one by one enable them
My initial thought is to store them in a kind o table so i could name them whatever i like and set the enabling order the way i want...
I am thinking of using a multicolumn hash table and iterate each time to find the next combo to enable.(Something like column1 :OrderID, column2:ControlName, column3:nextInOrderID <--- there is a necessity that after a specific combo gets selected more than 1 combobox gets enabled)
This should also works backwards...if a previous is set to null value it should disable and clear all the combo-boxes that were next in order.
Any ideas are welcomed
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!