HI
I need to show a editable JComboBox inside one of the JTable columns. I did use TableCellRenderer by extending JComboBox.
I can see JComboBox in my JTable, But How I can update all the combo boxes in that column with what ever user enters in any combo box. I want functionly something like IE browser showing existing login ids from text box, when ever we want to login.
I add code below. Please correct me if I am in worng path.
Any other example also helpful.
class CustomTaskCellRenderer
extendsJComboBox
implementsTableCellRenderer
{
privatebooleanisSelected;
privatebooleanhasFocus;
public CustomTaskCellRenderer()
{
setEditable(true) ;
setLightWeightPopupEnabled(true);
setMaximumRowCount(5);
}
public Component getTableCellRendererComponent( JTable table,Object value, boolean isSelected, boolean hasFocus,
int row, int column )
{
this.isSelected = isSelected;
this.hasFocus = hasFocus;
setSelectedItem((
String)value);
return this;
}
}
thanks in advance
mohana