Results 1 to 2 of 2
  1. #1
    geenni is offline Member
    Join Date
    Dec 2013
    Posts
    1
    Rep Power
    0

    Post How to test this class

    import java.awt.*;
    public class TestGraph
    { public static void main(String[] a)
    { BarGraphWriter e = new BarGraphWriter();
    e.setTitle("Days in first four months of the year");
    e.setAxes(20, 120, "30", 90); // x- and y-axes start at 20, 120
    // graph is 90 pixels high; top of graph is labelled "30"
    int scale_factor = 3;
    e.setBar1("Jan", 31 * scale_factor, Color.red); // Jan has 31 days
    e.setBar2("Feb", 28 * scale_factor, Color.white); // etc.
    e.setBar3("Mar", 31 * scale_factor, Color.blue);
    e.setBar4("Apr", 30 * scale_factor, Color.red);
    }
    }
    Last edited by geenni; 12-19-2013 at 09:47 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,516
    Rep Power
    25

    Default Re: How to test this class

    Please edit your post and wrap your code with code tags:
    [code]
    YOUR CODE HERE
    [/code]
    to get highlighting and preserve formatting.

    Use the java command to execute that class:
    java TestGraph
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 4
    Last Post: 10-25-2010, 03:49 PM

Tags for this Thread

Posting Permissions

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