File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JCombobox in JTable cell does not dropdown 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 "JCombobox in JTable cell does not dropdown" Watch "JCombobox in JTable cell does not dropdown" New topic
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
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

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.


GenRocket - A Test Data Generation Platform
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JCombobox in JTable cell does not dropdown
 
Similar Threads
JComboBox drop-down list extends past JDialog boundary
JComboBox in the JTable Editor
Obvious JCombobox in a JTable?
How to Set the JTable Rows Color??
ComboBox in JTable