If you want the action to occur when you click just
create a TableCellEditor like:
public class DoSomethingTableCellEditor
implements TableCellEditor {
public Component getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column) {
//Do Something
...
return null;
}
}
but that won't give you the visual impact of the button being pressed.
If you want that you'll need to return a button as the component from
the TableCellEditor (I believe the mouse down event is forwarded on
to the editor component so this should work).
Regards
Dave Wathen
Goldman Sachs Asset Management
3rd Floor, Procession House
55 Ludgate Hill
London EC4M 7JN
+44 (0)20-7774-2998
It is not necessary to understand things in order to argue about them.
(Caron de Beaumarchais)
-----Original Message-----
From: Bharat Dighe [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 20, 2001 11:27 AM
To: [EMAIL PROTECTED]
Subject: [Advanced-java] Button in table cells
Hi Folks,
I want to put buttons in the table cells.
I wrote a renederer extended from JButton, it gives me a button look but
does not give a click effect ( show pressed on mouse
click ).
Should I do something more ? Any clues or sample code ?
Thanks
- Bharat
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
Advanced-java mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/advanced-java
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing