About TableCellRenderer
1 posts in topic
Flat View  Flat View

Posted By:   Rahul_Dixit
Posted On:   Tuesday, July 31, 2001 05:35 PM

How can u add a TableCellRenderer to a JTable so that renderer
can identify any mouse events.

Re: About TableCellRenderer

Posted By:   Scott_Stanchfield  
Posted On:   Tuesday, August 14, 2001 02:31 AM

Renderers are simply "rubber stamps" that are used to paint a cell in a table. They are not live components.

You can deal with the mouse events in two ways:

  1. Add a mouse listener to the table itself, and check to see which cell the events occur on.
  2. Add a cell editor to the table

If you add a cell editor, you'll need to be sure your TableModel returns true for isCellEditable(row,column) for any cells you want to edit.

About | Sitemap | Contact