public class GraphicPanel extends JPanel int arr public GraphicPanel i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
public class GraphicPanel extends JPanel {
int[] arr;
public GraphicPanel(int[] arr) {
this.arr = arr;
}
@Override
public void paint(Graphics g) {
int i = 10;
for (Integer z : arr) {
g.drawLine(10, i, 10 + z, i);
i += 2;
}
}
}