aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Editable JCombobox in JTree Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Editable JCombobox in JTree" Watch "Editable JCombobox in JTree" New topic
Author

Editable JCombobox in JTree

Dhivya Krishnan
Greenhorn

Joined: Apr 27, 2010
Posts: 28
My tree contains some 8 columns.Each column has an individual combobox. In this i need only one column to be editable, i mean values in one combobox alone must be editable. On submit button., all these values must be sent to db. I need your help in the first part., having individual combobox in JTable, editable combobox in one column alone.

Thanks in Advance.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

I can't help but think that this question is in the wrong forum. Is this question about JSF?


JBoss In Action
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18115
    
    8

JTree is a Swing component. It doesn't have "columns" so the first sentence is kind of nonsense, but then the rest starts talking about JTable, which does have columns. At any rate it doesn't seem to be about anything but Swing (definitely not Ant or Maven or any other build tool whatsoever) so I will move it to the Swing column.

It would also help if Dhivya could clarify the question so we at least knew whether it was about JTree or JTable.
Dhivya Krishnan
Greenhorn

Joined: Apr 27, 2010
Posts: 28
very sorry., its JTable., each column in the JTable must have individual combobox in which one combo box is editable. for eg take combobox in the 5th column in the table is alone editable.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

Check out how TableCellEditors work for the combo box. DefaultCellEditor can be used for this. Override isCellEditable of your TableModel to determine for each cell separately if it should be editable or not.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Editable JCombobox in JTree
 
Similar Threads
JComboBOx in a Jtable
Apply JTable Cell Editor for a specific row/column.
Noneditable Combo
how to put images on displaytags column header????
how to add dropdownlistbox to text field