Drawing a simple line graph in Java
Problems with your code and suggestions: Again you need to change the preferredSize of the component (here the Graph JPanel), not the size Don’t set the JFrame’s bounds. Call pack() on your JFrame after adding components to it and before calling setVisible(true) Your foreach loop won’t work since the size of your ArrayList is 0 … Read more