I am at a very strange problem, I have a customized JPanel, which I want to draw a circle, but nothing happens … here is my source, hope somebody sees the mistake, I can’t find it.
import javax.swing.JPanel;
public class CircleView extends JPanel {
public CircleView() {}
@Override
public void paintComponent(Graphics g) {
g.setColor(Color.red);
g.drawOval(10, 10, 50, 50);
}
}
that not true at all
1) remove constructor
2) add
super.paintComponent(g);this one can run