• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to add Tree inside JComboBox  RSS feed

Mahesh Kedari
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Below is the requirement for which i need to add Tree inside JComboBox.
Im designing an inventory management application. While creating new product, I need to display a category and its sub category inside JComboBox. when user clicks on JComboBox, only parent categories should be displayed and when he clicks on + sign, child categories of selected category should be displayed.
The structure i m currently using is,
Add number of spaces before node name depending on the level of that node.
Like 3 spaces if its level is 3. etc.
I need to make this more user friendly adding JTree to JComboBox.

Maneesh Godbole
Posts: 11445
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!