| Author |
JCombobox in JTable cell does not dropdown
|
Rob Elliott
Greenhorn
Joined: Apr 24, 2002
Posts: 9
|
|
|
My JTable contains two columns, the 2nd column contains an extended JCombobox. The problem appears when the table contains multiple rows. When the table is displayed and I click on one of the Comboboxs it drops down as it should and I make a selection. I then click on another Combobox and the combobox is highlighted but the selection list does not drop down. I must click on it a 2nd time to make it drop down. Not sure how to resolve this one???
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
I think that possbily I know the reason for this, but not the solution. The reason I think is because the first time you click the Cell containing the JComboBox, you are simply selecting the Cell, then you are able to click the JComboBox. So hopefully someone knows why this is.
|
 |
Rob Elliott
Greenhorn
Joined: Apr 24, 2002
Posts: 9
|
|
|
The problem was that stopcellediting was not being called until the 2nd combobox was clicked, probably invoked by lostfocus. The solution was to implement ItemLister interface in my custum editor class (derived from DefaultCellEditor), and the ItemListener to the private Combobox member and in teh ItemStateChanged handler call stopCellEditing.
|
 |
 |
|
|
subject: JCombobox in JTable cell does not dropdown
|
|
|