Thanks for the fast responses.
I've been trying to use the following code, so that when the right mouse button is pressed I can get a print out of the row and column for the location the right mouse button was pressed over. This would be good enough, as I can highlight it from the listener with these details.
However, my problem is that when I right click it brings up the popup window, but I don't recieve and event in the listener. Do you know how I can right click to get the pop up but also get the corrodiantes of the click in the listener.
Thanks
Mike
- Code: Select all
table.getDataTable().addMouseListener( new MouseAdapter()
{
public void mouseClicked( MouseEvent e )
{
if ( SwingUtilities.isLeftMouseButton( e ) )
{
}
else if ( SwingUtilities.isRightMouseButton( e ) )
{
System.exit(0);
Point p = e.getPoint();
int rowNumber = table.getDataTable().rowAtPoint( p );
int colNumber = table.getDataTable().columnAtPoint( p );
log.out(rowNumber + " : " + colNumber);
}
}
});