kohinoor2007
Programmer
Hi guys,
Have a table ,in which Iam rendering a column to display as combobox while editing.
Iam doing it as follows.
// These are the combobox values
String[] values = new String[]{"item1", "item2", "item3"};
JComboBox comboBox = new JComboBox(values);
comboBox.setEditable(true);
sheetColumn.setCellEditor(new DefaultCellEditor(comboBox));
//sheetColumn is a column in my table.
Now when the user types in a key in the table cell,where a combobox is rendered into, want the combo drop down to open & show values correspong to the entered key.
As my combobox is an editable one,Know that I have to use the "SelectionForKey" function.
How will I get my combobox from the table,to call the "comboBox.SelectionForKey" from the listener as described below
Have added a listener as follows:
Would be nice if some one could show it with a code snippet from this point on..
table.addKeyListener(new KeyAdapter(){
public void keyTyped(KeyEvent e){
char c = e.getKeyChar();
})
}
Thanks...
Have a table ,in which Iam rendering a column to display as combobox while editing.
Iam doing it as follows.
// These are the combobox values
String[] values = new String[]{"item1", "item2", "item3"};
JComboBox comboBox = new JComboBox(values);
comboBox.setEditable(true);
sheetColumn.setCellEditor(new DefaultCellEditor(comboBox));
//sheetColumn is a column in my table.
Now when the user types in a key in the table cell,where a combobox is rendered into, want the combo drop down to open & show values correspong to the entered key.
As my combobox is an editable one,Know that I have to use the "SelectionForKey" function.
How will I get my combobox from the table,to call the "comboBox.SelectionForKey" from the listener as described below
Have added a listener as follows:
Would be nice if some one could show it with a code snippet from this point on..
table.addKeyListener(new KeyAdapter(){
public void keyTyped(KeyEvent e){
char c = e.getKeyChar();
})
}
Thanks...