Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Jpanel and Color  RSS feed

 
Raj
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I need to create a Frame and a Panel inside it Which has Green Colour in it


well this is wht i have writen



Now How do i fill in the colour in the panel
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apart from finding out which numbers give your pale green, do you mean?
[ October 11, 2008: Message edited by: Campbell Ritchie ]
 
Raj
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well is there another way to do it ....
 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ANC",

your name violates our naming policy. Please change it accordingly.

Thank you,

Rob
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see a couple of problems including that you're mixing AWT (i.e., Label) and Swing (i.e., everything else) components, and this can lead to trouble if done without extreme care and without a good reason (which I don't see at present).

Also, what are you trying to do here?:

This method returns a Color object while states it should return a Paint object. Does this compile?

Finally, the setBackground(Color c) method is probably the best way to set a JPanel's color that I know of.
 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rob Prime:
"ANC",

your name violates our naming policy. Please change it accordingly.

Thank you,

Rob

Raj, please read the naming policy. You obviously haven't yet.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!