Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Populate Combo boxes dynamically  RSS feed

 
John Tsioumpris
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to everybody
I have a situation in which i need to populate a number combo boxes dynamically
Let me explain :
I have a JavaFX form with 5 combo boxes
I also have a directory which has several subdirectories
I want to populate the combo boxes according to name of subdirectory
e.g
root_Directory
|
|--->Animals (some files in it)
|--->Plants (some files in it)
|--->Vehicles (some files in it)

I have lets say 2 combo boxes named Animalscbo & Vehiclescbo
I have an Array of the subdirectories of root_Directory and i want to iterate and when i find a matching subdirectory - combo-box (minus the cbo postfix) to populate the combobox with the contents of subdirectory...
Please take special note that i need this to be totally dynamic....it searches the JavaFX form and whenever it finds a combobox with matching name it populates it...
Any help?
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this is a JavaFX question, I've added it to the appropriate section.
 
John Tsioumpris
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:Since this is a JavaFX question, I've added it to the appropriate section.

Thanks....
 
John Damien Smith
Ranch Hand
Posts: 338
21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See: http://stackoverflow.com/questions/20794359/javafx-cascading-dropdown-based-on-selection

Is this what you want to do?

I'm not quite sure from reading your question. In particular I don't quite know what this means:
"it searches the JavaFX form and whenever it finds a combobox with matching name it populates it"
What is the JavaFX form, what is doing the searching and how is it doing it?
Maybe providing an mcve might help?
 
John Tsioumpris
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks i will give it a try
 
John Tsioumpris
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well i haven't read the post but here is my implementation


I would like some help in making it **beautifull**
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!