0

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.

http://pastie.org/private/znexgtf7uskpapd4cuaoq#146,153

friedrojak
  • 57
  • 1
  • 13
  • 2
    Post an MCVE here, not at a link that might go stale, and that many people will not or cannot follow. 1) For better help sooner, post an [MCVE](http://stackoverflow.com/help/mcve) (Minimal Complete Verifiable Example) or [SSCCE](http://www.sscce.org/) (Short, Self Contained, Correct Example). 2) One way to get image(s) for an example is to hot link to images seen in [this Q&A](http://stackoverflow.com/q/19209650/418556). – Andrew Thompson Feb 08 '15 at 12:12
  • 2
    And make sure your code is properly formatted. It is very rude to be asking people to go through the trouble of reading your code when you have not bothered to format it properly. – Mike Nakis Feb 08 '15 at 12:16

1 Answers1

1

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

Titus
  • 22,031
  • 1
  • 23
  • 33