Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

White bars on bottom and top of JFrame

 
Kody Wright
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add these lines at an appropriate place in your code:What do you see?
 
Matthew Brown
Bartender
Posts: 4565
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, I feel like an idiot lol. Thanks for the help and quick replies!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic