public void paintComponent(Graphics g) {
        super.paintComponent(g);
        for (MyLine line : lines) {
           line.draw(g);
        }
        for (MyRectangle rectangle : rectangles) {
            rectangle.draw(g, rectangle.getFilled());
        }
        for (MyOval oval : ovals) {
            oval.draw(g, oval.getFilled());
        }
    }