• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to add Tree inside JComboBox

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
Saloon Keeper
Posts: 11257
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic