How to detect single click on any cell of JTable ?
Mahajan Bhupendra
Ranch Hand
Joined: Dec 01, 2000
Posts: 118
posted
0
Hi i m using JTable in my application i want to detect a mouse click on any cell with cell row and col number.. how should i do that because JTable is having only TableEventListener which detects only change in table cell.. Bhupendra Mahajan
<B>Bhupendra Mahajan</B>
Paul Stevens
Ranch Hand
Joined: May 17, 2001
Posts: 2823
posted
0
In your mouse event code put in this: Point pnt = evt.getPoint(); int row = table.rowAtPoint(pnt); int col = table.columnAtPoint(pnt);
That will give you the row and column.
Mahajan Bhupendra
Ranch Hand
Joined: Dec 01, 2000
Posts: 118
posted
0
Thankx paul It works... How u have so much knowledge and i don't?? Bhupendra Mahajan
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: How to detect single click on any cell of JTable ?