i am writing a program that when the mouse is clicked, a circle will be drawn. The below code i\'ve wrote so far.
import java.awt.*; import javax.swing.*; i
Change your mouseClick(...) to:
mouseClick(...)
int x, y; public void mouseClicked(MouseEvent e) { x = e.getX(); y = e.getY(); repaint(); }
Override paint(...):
paint(...)
@Override public void paint(Graphics g) { drawCircle(x, y); }