kohinoor2007
Programmer
I have rendered a column of my table with a combobox.Some questions surfaced when I worked deep in to it.
I have rendered the cell which would look like a combobox only on editing as follows.
sheetColumn.setCellEditor(new DefaultCellEditor(comboBox));
//sheetColumn is my column name.
Have a function in my class,as below,where Iam passing the combo and want to trap the keypress events on the combo.
public void addKeyListener(final JComboBox test){
Component comp1;
comp1 = test.getEditor().getEditorComponent(); //[1]
My questions are :
[1]What does [1] return :--> a JComboBox
So for example if I have a "KeyPressed" event handler as follows:
public void keyPressed(KeyEvent e){
e.getSource();
e.getComponent();
}}
[2]What does "getSource" & "getComponent" return.Do they return the same JComboBox as [1].
Thanks