JPanel+Image
Hi,
I want to display a graph (image) in a Jpanel. How can I dynamically set a new graph as users press startButton.
if(evt.getSource().equals(startButton)){
addImage(jPanel4,img);
getContentPane().add(jPanel4);
jPanel4.setBounds(340, 180, 322, 250);
jPanel4.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); }
For this code: it correclty displays the image, but pressing the startButton twice, e.g. during certain run did not display a new figure (it should do becuase my program gives different results each time the user presses StartButton). However, if I run the program again (by closing and running) it will disply it correctly.

