IntelliJ Java IDE
The moose likes Swing / AWT / SWT / JFace and the fly likes Components inside JComboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "Components inside JComboBox" Watch "Components inside JComboBox" New topic
Author

Components inside JComboBox

Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 504

Hi,
I need to have a JComboBox in this fashion. On selecting the drop down,

checkbox1 text1
checkbox2 text2
.
.
.
checkboxn textn


should be displayed.

Iam very new to Swing/Awt UI stuff and I figured out that I need to add a component inside the JCombobox I create. I Don't know if I can achieve this by adding a JCheckBox component or I need to create a JPanel for this.

I have created many JCheckBox components and tried to add it and display but nothing was visible inside the JComboBox I created. I don't know how to change the default renderer for the JComboBox and make it render this kind of JComboBox.

Please take a look at the code I have written.


Any Help would be deeply appreciated and please forgive me if my code was dumb.
[ June 02, 2006: Message edited by: Arun Kumarr ]

If you are not laughing at yourself, then you just didn't get the joke.
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 504

Thanks Craig.
You have made me watch the climax. I'll have to find out how exactly the renderer is working. :roll:
 
IntelliJ Java IDE
 
subject: Components inside JComboBox
 
Threads others viewed
ideas wanted on making this custom JTable cell renderer more efficient
Using a custom renderer for JComboBox
JButton not working
MultipleSelect JComboBox
JPopupMenu is not diplaying to the right of the mouse click when i right click on a JCheckbox
IntelliJ Java IDE