Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can we color a Frame.  RSS feed

 
P Jain
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
How can we do coloring on frame (not by icons). I just want to color my main frame and its button with different colors. How can I do it.

Thanks
PJain
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using setBackground(...) for the Frame and the Button.

Cheers,
Rachel
 
P Jain
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Its not working.
 
P Jain
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Sorry,Its now working.
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This code must work:
getContentPane().setBackground(new Color(125, 165, 209));

Btw, you may try JFrameBuilder which would be a good alive Swing Tutorial for you, all the questions like this kind must be solved in 2 seconds.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!