This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Graphics to Draw Shapes  RSS feed

 
John Jacksons
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am new to this thread.

I have the following problem:

"In your Java1_Homework working set, create a new project named Cartman_Project. Copy the Cartman.java and Drawtest.java classes from the lesson into Cartman_Project.
Change the Cartman.java code to make your Cartman look as much like the following picture as you can."

I have to create a Cartman (from the TV show Southpark). This is what it looks like: http://images2.wikia.nocookie.net/__cb20111214222747/southpark/images/9/9e/Eric_cartman.png

Here is the code I have so far. I'm not sure how to create the hat, and yellow rim, though.


Many help is greatly appreciated!!! Thanks.
 
Joel Christophel
Ranch Hand
Posts: 250
1
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use colors other than the ones the Color class provides you with. The face is about FAF7D4 in hex, so you could do new Color(0xFAF7D4);

If you cast your Graphics object to a Graphics2D object, you will then be able to set your stroke size. With a thicker stroke size, the drawArc method should work well.
 
Campbell Ritchie
Sheriff
Posts: 53750
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I shall move this discussion to our GUIs forum ,where we usually discuss such questions.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!