It's not a secret anymore!*
The moose likes Swing / AWT / SWT and the fly likes how to use rgb color values to set JPanel background color Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to use rgb color values to set JPanel background color" Watch "how to use rgb color values to set JPanel background color" New topic
Author

how to use rgb color values to set JPanel background color

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2
how to use RGB values to set JPanel Background color, which is not in the color list...
i tried like this but not working for me..



Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4547
    
    5

Use code tags, not quote tags for code. I've fixed it for you this time.

Your code looks reasonable, which usually means the problem is elsewhere, in code you haven't shown us. To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

edit No, it isn't reasonable. Why do you qualify the variable myBlue with the Color class? That shouldn't even compile, and doesn't make any sense.


luck, db
There are no new questions, but there may be new answers.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2
yes i got it it's working for me now thanks...

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to use rgb color values to set JPanel background color