Solved

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

Posted on 2004-09-29
5
642 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

726 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