Results 1 to 6 of 6
  1. #1
    Everyman's Avatar
    Everyman is offline Member
    Join Date
    Feb 2012
    Location
    Everywhere
    Posts
    26
    Rep Power
    0

    Default The Graphics Class

    I am new to Java and I don't really know a lot about the graphics class. I have been out of school for a few days of my class and I haven't had time to do it at home because of work. Could someone please explain to me what to do and how to do it? We can start with this:

    "Given g, a reference to a Graphics object, use a constant defined in the Color class to write a statement that arranges for the next drawn rectangle to be red:"

  2. #2
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,931
    Rep Power
    19

    Default Re: The Graphics Class

    Here's the Java 6 API.
    You can find the referred to classes here.
    That should give you a start point.

  3. #3
    Everyman's Avatar
    Everyman is offline Member
    Join Date
    Feb 2012
    Location
    Everywhere
    Posts
    26
    Rep Power
    0

    Default Re: The Graphics Class

    Okay, I tried "static Color red," but that didn't work. What should I do now? I have no idea what a constant is, and I think thats what is messing me up.

  4. #4
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,931
    Rep Power
    19

    Default Re: The Graphics Class

    "didn't work" tell us nothing.
    What does your code look like and what errors are you getting?

  5. #5
    Everyman's Avatar
    Everyman is offline Member
    Join Date
    Feb 2012
    Location
    Everywhere
    Posts
    26
    Rep Power
    0

    Default Re: The Graphics Class

    Ohhh.... I got it now. MyProgrammingLab wanted me to input the answer in a certain way. This website has been giving me trouble for the past three weeks. Thanks for the links to the website. They really helped.

  6. #6
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,931
    Rep Power
    19

    Default Re: The Graphics Class

    That's the Java API over at Oracle.
    That should be one of your bookmarks if you're going to do much Java stuff...it'll be the first place people on a forum will link you to if there's any API-related questions (usually things like "how do I do XYZ with this class?").

Similar Threads

  1. Replies: 5
    Last Post: 10-02-2011, 02:55 AM
  2. Drawing a graphics onto another Graphics ?
    By Ziden in forum Java Applets
    Replies: 0
    Last Post: 01-08-2011, 07:30 PM
  3. ending a graphics class
    By imorio in forum AWT / Swing
    Replies: 11
    Last Post: 08-16-2010, 05:41 PM
  4. Problem in g.drawArc() api of Graphics class
    By narasimman in forum AWT / Swing
    Replies: 0
    Last Post: 07-30-2008, 08:19 AM
  5. Graphics
    By Joe2003 in forum Advanced Java
    Replies: 1
    Last Post: 01-25-2008, 06:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •