public class TableRowMouseAdapter extends MouseAdapter
MouseAdapter
for handling single-
and double-clicks on rows in a JTable
.
The following example illustrates how this adapter might be used:
table.addMouseListener(new TableRowMouseAdapter() { public void rowClicked(int row, int button) { System.out.println("Button " + button + " clicked on row #" + row); } });
Constructor and Description |
---|
TableRowMouseAdapter()
Construct a new
TableRowMouseAdapter . |
Modifier and Type | Method and Description |
---|---|
void |
mouseClicked(MouseEvent evt)
Handle a mouse event.
|
void |
rowClicked(int row,
int button)
Handle a single-click on a row.
|
void |
rowDoubleClicked(int row,
int button)
Handle a double-click on a row.
|
mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved
public TableRowMouseAdapter()
TableRowMouseAdapter
.public final void mouseClicked(MouseEvent evt)
JTable
; if it is not,
the event is ignored.mouseClicked
in interface MouseListener
mouseClicked
in class MouseAdapter
evt
- The event.public void rowClicked(int row, int button)
row
- The index of the row that was clicked on.button
- The mouse button that was clicked.public void rowDoubleClicked(int row, int button)
row
- The index of the row that was clicked on.button
- The mouse button that was clicked.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses