Re: Doble click on a JTable

From: Christophe Vanfleteren (c.v4nfl3t3r3n_at_pandora.be)
Date: 07/30/04


Date: Fri, 30 Jul 2004 21:46:21 GMT

alexjcasol wrote:

> Hi all,
> does anyone know how to handle the double click event on a JTable?
>
> I wrote the following code:
>
> table.addMouseListener(new MouseAdapter()
> {
> public void mouseClicked(MouseEvent e)
> {
> if (e.getClickCount() == 2)
> some_statement;
> }
> });
>
> but it works only if I click on the lines of the table and it doesn't if
> I click in the middle of a cell.

select * from double_click where is_middle_of_cell = true;

Or you could just try c.l.j.gui instead :)

-- 
Kind regards,
Christophe Vanfleteren


Relevant Pages

  • Re: why use final here
    ... btnClr.addMouseListener(new MouseAdapter() { ... class MyMouseAdapter extends MouseAdapter { ... public void mouseClicked{ ... The problem is that use of mainWindow (as used for the mouseClick ...
    (comp.lang.java.help)
  • Re: why use final here
    ... btnClr.addMouseListener(new MouseAdapter() { ... public void mouseClicked{ ... The problem is that use of mainWindow (as used for the mouseClick ... synthetic variable refers to the same Frame mainWindow does, ...
    (comp.lang.java.help)
  • why use final here
    ... class MouseEvents { ... btnClr.addMouseListener(new MouseAdapter() { ... public void mouseClicked{ ... The problem is that use of mainWindow (as used for the mouseClick ...
    (comp.lang.java.help)
  • Re: Receiving MouseEvents from unused area in a container
    ... ;-) */ class TableClick { ... t.addMouseListener(new MouseAdapter() {public void mouseClicked{ ... HTH ...
    (comp.lang.java.gui)