Solved

make a line, triangle or polygon .......

Posted on 2004-09-29
5
643 Views
Last Modified: 2010-08-05
Hi Experts,

    what kinds of function should I use in order to create a line, triangle, or polygon ? thanks.
0
Comment
Question by:meow00
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
Javatm earned 150 total points
ID: 12186152
Creating a graphics in java is as simple as :

public void paint(Graphics g)
    {
    // To draw a line . . .
    g.drawLine(1, 1, 200, 200);
    }

Here's a tutorial that will help :
http://computer.howstuffworks.com/program4.htm

Hope that helps . . .
Javatm
0
 
LVL 15

Expert Comment

by:Javatm
ID: 12186205
0
 
LVL 12

Assisted Solution

by:Giant2
Giant2 earned 150 total points
ID: 12187364
see here for a full sun tutorial about this argument.
http://java.sun.com/docs/books/tutorial/uiswing/14painting/index.html

Bye, Giant.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question