I'm having troubles here with adding photos into my GUI. I have created a JPanel and im using that to add my photos in. However, when i uncomment line 156, everything in my GUI is gone except for the photo.
Im referring to line 149-156.
I'm having troubles here with adding photos into my GUI. I have created a JPanel and im using that to add my photos in. However, when i uncomment line 156, everything in my GUI is gone except for the photo.
Im referring to line 149-156.
Your contentPane panel uses a BorderLayout and because of that when you uncomment the line contentPane.add(panel_4); panel panel_4 will replace the previous panel that was set as BorderLayout.CENTER which in this case is tabbedPane.
As is mentioned in the documentation for BorderLayout:
Each region may contain no more then one container. ..... BorderLayout interprets the absence of a string specification the same as the constant CENTER