• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1110
  • Last Modified:

JTree as renderer of combobox

Hi,

I want to create a ComboBox that, when the down arrow is clicked, instead of a list coming up, a JTree comes up (generally it'll be just like a list, but sometimes things will be nested 1 level).

The user can choose a node in the JTree, and that becomes the selected item (showing up in the un-expanded combobox and, preferably, firing an even with it as the newly selected object).

Could somebody at least point me in the right direction of where to start?
0
phavardel
Asked:
phavardel
  • 2
2 Solutions
 
CEHJCommented:
You need to write your own ListCellRenderer. See API doc

http://java.sun.com/javase/6/docs/api/javax/swing/ListCellRenderer.html
0
 
Mayank SAssociate Director - Product EngineeringCommented:
0
 
objectsCommented:
cannot be done (easily)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now