This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes White bars on bottom and top of JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "White bars on bottom and top of JFrame" Watch "White bars on bottom and top of JFrame" New topic
Author

White bars on bottom and top of JFrame

Kody Wright
Ranch Hand

Joined: Mar 06, 2011
Posts: 32
Hey Guys : )

So I'm working on a school project setting up a GUI, and I can't seem to get rid of this problem. Initially I had an issue trying to get the frame background to be a certain color; I was unable to color the frame itself so I just added another panel inside the frame and colored it. Now that I've got the colored frame in, there are two white bars that appear on the bottom and top of the panel that I can't get to go away. I'll include the code below if anyone wants to run it and see what I'm talking about. Just an FYI: I'm using eclipse.

Thanks for all the help!

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4531
    
    5

Add these lines at an appropriate place in your code:What do you see?

luck, db
There are no new questions, but there may be new answers.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4375
    
    8

The white bars are p1 and p2 - set their colour to something like Color.RED if you want to confirm it. Remove them and the bars go away. Were they a remnant of a previous design or something?
Kody Wright
Ranch Hand

Joined: Mar 06, 2011
Posts: 32
Wow, I feel like an idiot lol. Thanks for the help and quick replies!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: White bars on bottom and top of JFrame