--
You received this message because you are subscribed to the Google Groups "CheerpJ Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cheerpj-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cheerpj-developers/b0086a80-a49e-4e3f-b252-e8ef3053085b%40googlegroups.com.
public class App extends JPanel {
private Point movePoint;
public App() {
setBackground(Color.black);
addMouseMotionListener(new MouseAdapter() {
@Override
public void mouseMoved(MouseEvent e) {
movePoint = e.getPoint();
repaint();
}
});
}
@Override public void paintComponent(Graphics g) {
super.paintComponents(g);
g.setColor(Color.red);
if (movePoint != null) g.fillOval(movePoint.x, movePoint.y, 10, 10);
Point p = getMousePosition();
g.setColor(Color.green);
if (p != null) g.drawRect(p.x, p.y, 10, 10);
}
public static void main(String[] args) throws IOException {
App app = new App();
JFrame frame = new JFrame();
frame.add("Center", app);
frame.setSize(500, 200);
frame.setVisible(true);
--
You received this message because you are subscribed to the Google Groups "CheerpJ Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cheerpj-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cheerpj-developers/caf38331-a0a2-4994-b5f8-e0f7ef463836%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "CheerpJ Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cheerpj-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cheerpj-developers/caf38331-a0a2-4994-b5f8-e0f7ef463836%40googlegroups.com.