?
Solved

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

Posted on 2004-09-29
5
Medium Priority
?
644 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 600 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 600 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month8 days, 18 hours left to enroll

764 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