title: Get position of Click JTable while using Cell renderer
body: <p>I'm currently using a JTable in Java to display a large amount of text information,  and as such have implemented text wrapping, using the following code:</p>
  
  <pre><code>MyCellRenderer mcr = new MyCellRenderer();
  table.getColumnModel().getColumn(0).setCellRenderer(mcr);
  
  class MyCellRenderer extends JTextArea implements TableCellRenderer {
    public MyCellRenderer() {
  setLineWrap(true);
  setWrapStyleWord(true);
  
   }
  
  public Component getTableCellRendererComponent(JTable table, Object
      value, boolean isSelected, boolean hasFocus, int row, int column) {
  setText(value.toString());
  setSize(table.getColumnModel().getColumn(column).getWidth(),
          getPreferredSize().height);
  if (table.getRowHeight(row) != getPreferredSize().height) {
          table.setRowHeight(row, getPreferredSize().height);
  }
  return this;
  }
  } 
  </code></pre>
  
  <p>However, when this is implemented, any attempt to detect the cell which is clicked, simply returns "-1" (out of bounds) as the point of click, I am using the following code to detect the click location:</p>
  
  <pre><code>table.addMouseListener(new java.awt.event.MouseAdapter() {
  
    public void mouseClicked(java.awt.event.MouseEvent e) {
      int row = table.rowAtPoint( e.getPoint() );
      int column = table.columnAtPoint( e.getPoint() );
    }
  });
  }
  </code></pre>
  
  <p>Is there any way, whilst maintaining the text wrapping, that I can text the cell which is clicked in the JTable?</p>