Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setBackground(Color.color) does not color the main Frame

 
Ted Schrey
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nothing happens (color-wise) when I use .setBackground(Color.red) (or any color) on the JFrame... I have to add a Panel and then color the Panel (using same method). Everything I've read indicates that the JFrame should color, but it doesn't with code like this:

 
Darryl Burke
Bartender
Posts: 5155
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ted Schrey wrote:Everything I've read indicates that the JFrame should color

Then you haven't read the API for RootPaneContainer, one of the interfaces implemented by JFrame, nor the Oracle tutorial on Using Top-Level Containers
 
Ted Schrey
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did, but I missed that I needed to .getContentPane() THANK YOU.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!