Hey fellas I need some help writing a program that plots two points on a graph in point intercept form in (x,y). I have recently programmed a times table program. i just don't understand how to graph points.
thanks for your help!
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hey fellas I need some help writing a program that plots two points on a graph in point intercept form in (x,y). I have recently programmed a times table program. i just don't understand how to graph points.
thanks for your help!
What you could do is draw points on a JPanel or other JComponent by editing that component's paintComponent() method. In this case, you would simply use the x, y coordinates and that would translate onto the panel (ie, the point (50, 100) would be used to draw a dot 50 px from the top of the panel and 100 from the left). Note that using this method, y grows larger as you move DOWN the panel (so you'd have to invert the y coordinate).
Sorry I can't be more clear... Gotta go to a band concert!
Use highlight tags to help others help you!
[highlight=Java]Your prettily formatted code goes here[/highlight]
Using these tags makes your code formatted, and helps everyone answer your questions more easily!
Wanna hear something funny?
Me too.
In the paintComponents() method you can use the Graphics class's drawOval method to draw a point.how to graph points.
Look at the other methods of the Graphics class to see if there are other's that might help you.