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

2
  • 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 (Minimal Complete Verifiable Example) or SSCCE (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. Commented Feb 8, 2015 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. Commented Feb 8, 2015 at 12:16

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.