Guest User

Untitled

a guest
Mar 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. ToolTipManager.sharedInstance().registerComponent(jgraph);
  2.  
  3. jgraph.addMouseListener(new MouseAdapter() {
  4. public void mousePressed(MouseEvent e) {
  5. if (e.getClickCount() == 2) {
  6. int x = e.getX(), y = e.getY();
  7. Object cell= jgraph.getFirstCellForLocation(x, y);
  8.  
  9. if (cell != null) {
  10. String lab = jgraph.convertValueToString(cell);
  11. jgraph.setToolTipText(lab);
  12.  
  13. System.out.println(lab);
  14. }
  15. }
  16. }
  17. });
Add Comment
Please, Sign In to add comment