GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes JTable Cell Editor[JComboBox] Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable Cell Editor[JComboBox] Problem" Watch "JTable Cell Editor[JComboBox] Problem" New topic
Author

JTable Cell Editor[JComboBox] Problem

vinaya kumar
Greenhorn

Joined: Jan 15, 2002
Posts: 8
Hello All,
I have a JTable with one of the cell Editor has
JComboBox.
when i click on the cell with
mouse ,i get the combobox editor
but by using Tab ,i end just getting the cell
without the combobox...

anyclue! what can be wrong ,or what to do!!!
Thanks
vinaya


vinaya kumar
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

First, vinay, please re-register with a name that follows the JavaRanch UserName Conventions. Your username needs to be in the format "First Name" + space + "Last Name"...

Are you adding a new TableCellRenderer as well as a TableCellEditor? The TableCellRenderer determines how the table cell normally looks. Also, just tabbing into the cell doesn't tell the table cell you want to edit it... only clicking the cell does that by default.

I've been playing around with this, and it looks like you may be able to do what you want by adding a KeyListener to your TableCellEditor component...

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
vinaya kumar
Greenhorn

Joined: Jan 15, 2002
Posts: 8
Hello,
1) Plz Let me know steps to do changes my login name.[ could not find how to change
the login name]
2) I have added the Key Listener also,
I listen to space,then say combobox.showPopup
but combobox appears and when i press the
combobox disappears and i get an expection
in showpopup.
All i want is a celleditor for a column to be
combobox, and when i traverse to the cell,
i should be able to select a combobox.
Thanks
vinaya
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

To re-register, all you have to do is click log out right after "Hello, vinay" under the moose head picture at the top left of this page. Then click register at the top right of this page. Then just fill out your information again, putting vinaya kumar instead of just vinay in the Login Name field.

I've been messing around with some code trying to fix what you want... it looks like the table is "eating" all the key events sent to it... so I'm going to try and find out how to make a table send an event to it's component instead of itself...

-Nate
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable Cell Editor[JComboBox] Problem