i am reading core java 2 vol 1 by horstmann & cornell .in this book ,in the chapter of event handling .he has written method
i have not understood what does this 'for' loop mean.it is giving me error too.Code:public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2=(Graphics2D) g; for(Line2D l: lines) { g2.draw(l); } } private ArrayList<Line2D> lines;
how to fix it
also in the declaration
private ArrayList<Line2D> lines;
<Line2D> gives me error




Reply With Quote