I am trying to draw at my mouse a certain shape that I have set. I defined some shapes where they extend shape and draw circles and stuff. But when I click on panel it seems the paint doesnt put anything on the white jpanel. Debugger tells me shapes are saved though.
public void mouseClicked(MouseEvent e) {
currentX = e.getX();
currentY = e.getY();
Shape newShape = owner.currentBrush.clone();
picture.add(newShape);
repaint();
}
public void paint(Graphics g){
super.paint(g);
for( int i = 0; i < myShapes.size(); i++ ){
picture.get(i).draw(g);
}
}
public void draw(Graphics g){
Graphics g2d = (Graphics2D) g;
g2d.setColor(Color.BLUE);
g2d.fillOval(getX(), getY(), radius, radius);
g.drawOval(getX(), getY(), radius, radius);
}