import java.awt.Point;

public class Autoaim {
    public static void main(String[] args) {
        JFrame frame = new JFrame("Autoaim");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(500, 500);

        JPanel panel = new JPanel() {
            @Override
            protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.setColor(Color.RED);
                g.fillOval(1560, 160, 60, 60);
            }
        };

        panel.addMouseMotionListener(new MouseMotionAdapter() {
            @Override
            public void mouseMoved(MouseEvent e) {
                int x = e.getX();
                int y = e.getY();
                double distance = Math.sqrt(Math.pow(x - 200, 2) + Math.pow(y - 200, 2));
                if (distance <= 85) {
                    System.out.println("Aimed at the target");
                } else {
                    panel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                }
            }
        });

        frame.add(panel);
        frame.setVisible(true);
    }
}