Im a newbeginner on painting in java ... Im trying to paint a circle in a JPanel.
I made a class for the painting:
and in my GUI constructor i made a object and added it to my panel.Code:import javax.swing.*;
import java.awt.*;
public class Graphic extends JPanel {
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLACK);
g.fillOval(400, 400, 50, 50);
}
}
so why is it not painting anyting??? ThanksCode:Graphic g = new Graphic();
cordinatepanel.add(g);

