Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Populate Combo boxes dynamically

 
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?
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • 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....
 
Rancher
Posts: 387
30
  • 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**
 
reply
    Bookmark Topic Watch Topic
  • New Topic