[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1109
  • 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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

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