Guest User

Untitled

a guest
Jan 17th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. int selRow = myTaskTable.getSelectedRow();
  2.  
  3. ...
  4. myTaskTable.addMouseListener(this);
  5. ...
  6. public void mouseClicked(MouseEvent e)
  7. {
  8. if(e.getModifiers() == MouseEvent.BUTTON1_MASK)
  9. {
  10. if(e.getClickCount() == 2)
  11. {
  12. e.consume();
  13. int selRow = myTaskTable.getSelectedRow();
  14. System.out.println("GridReport double clicked on row="+selRow);
  15. }
  16. }
  17. }
  18.  
  19. final int selectedRowIndex = table.rowAtPoint(mouseEvent.getPoint());
  20. // If the rows are sorted or filtered
  21. final int modelRowIndex = table.convertRowIndexToModel(selectedRowIndex);
  22.  
  23. public void mouseClicked(MouseEvent e){
  24. if(e.getModifiers() == MouseEvent.BUTTON1_MASK){
  25. if(e.getClickCount() == 2){
  26. int selRow = myTaskTable.getSelectedRow();
  27. System.out.println("GridReport double clicked on row="+selRow);
  28. e.consume();
  29. }
  30. }
  31. }
Add Comment
Please, Sign In to add comment