I have been trying to figure this out why not the next picture showing on the same panel after click the button. I want to separate those classes not into one class and used rep
Why not change your approach and make use of a JLabel instead? Set your image as an icon on the label and add it to your JPanel:
BufferedImage image = ImageIO.read(new File("image-path"));
JLabel label = new JLabel(new ImageIcon(image));
panel.add(label);
You can then make subsequent calls to JLabel#setIcon(...)
each time you want the image to change.