Hi,
I'm trying - unsuccessfully - to insert a JMenu in a JTable cell. The
JMenu appears correctly but nothing appends when I click on the arrow
in order to display the menu items.
Is that possible?
Here a piece of my code.
____________________________________________
private class MenuRenderer extends JMenu implements TableCellRenderer {
public MenuRenderer()
{
super();
}
public Component getTableCellRendererComponent(JTable table, Object
menu, boolean isSelected, boolean hasFocus, int row, int column)
{
this.add((JMenu)menu);
return this;
}
}
____________________________________________
JTable l_table = new JTable(l_tableModel);
l_table.setDefaultRenderer(JMenu.class, new MenuRenderer());
____________________________________________
/**
* In my Table Model class I insert a JMenu object in the correct cell
and
* I define, among others, this method:
*/
public Class getColumnClass(int c)
{
return getValueAt(0, c).getClass();
}
____________________________________________
Thank you for having read this msg and for your advices.
-o
Arnaud Berger - 17 Jun 2005 10:15 GMT
Hi,
A menu would be an editor rather than a renderer....
Regards,
Arnaud
> Hi,
>
[quoted text clipped - 39 lines]
>
> -o