Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using hex colour code

807601Jan 7 2008 — edited Jan 7 2008
I'm currently coding a priject for my university and I'm having some trouble.

Here is a part of the code:

grass = new Square();
grass.changeoColor("Green");
grass.changeSize(1000, 700);
grass.moveHorizontal(-200);
grass.moveVertical(350);
grass.makeVisible();

This creates a square that stretches to make it look like grass. Now I want to add some little bushes to make it look more genuine. The problem I have is that I'm limited to only using the string Green as a green colour. I would like to know how it is possible to apply a hex colour code to the grass.

Thank you!

Edited by: Slands on Jan 7, 2008 6:50 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2008
Added on Jan 7 2008
8 comments
231 views