Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. //
  2. // Source code recreated from a .class file by IntelliJ IDEA
  3. // (powered by Fernflower decompiler)
  4. //
  5.  
  6. package jaja;
  7.  
  8. import java.awt.MouseInfo;
  9. import java.awt.event.MouseEvent;
  10. import java.awt.event.MouseMotionListener;
  11. import javax.swing.JTextField;
  12.  
  13.  
  14. public class MyMouseMotionAdapter implements MouseMotionListener {
  15.     int x;
  16.     int y;
  17.     public JTextField text;
  18.  
  19.     public MyMouseMotionAdapter(JTextField textField) {
  20.         this.text = textField;
  21.     }
  22.  
  23.     public void mouseDragged(MouseEvent var1) {
  24.         this.x = MouseInfo.getPointerInfo().getLocation().x;
  25.         this.y = MouseInfo.getPointerInfo().getLocation().y;
  26.         this.text.setText("X = " + String.valueOf(this.x) + " Y = " + this.y);
  27.     }
  28.  
  29.     public void mouseMoved(MouseEvent var1) {
  30.         this.x = MouseInfo.getPointerInfo().getLocation().x;
  31.         this.y = MouseInfo.getPointerInfo().getLocation().y;
  32.         this.text.setText("X = " + String.valueOf(this.x) + " Y = " + this.y);
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement