Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Source code recreated from a .class file by IntelliJ IDEA
- // (powered by Fernflower decompiler)
- //
- package jaja;
- import java.awt.MouseInfo;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseMotionListener;
- import javax.swing.JTextField;
- public class MyMouseMotionAdapter implements MouseMotionListener {
- int x;
- int y;
- public JTextField text;
- public MyMouseMotionAdapter(JTextField textField) {
- this.text = textField;
- }
- public void mouseDragged(MouseEvent var1) {
- this.x = MouseInfo.getPointerInfo().getLocation().x;
- this.y = MouseInfo.getPointerInfo().getLocation().y;
- this.text.setText("X = " + String.valueOf(this.x) + " Y = " + this.y);
- }
- public void mouseMoved(MouseEvent var1) {
- this.x = MouseInfo.getPointerInfo().getLocation().x;
- this.y = MouseInfo.getPointerInfo().getLocation().y;
- this.text.setText("X = " + String.valueOf(this.x) + " Y = " + this.y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement