Solved

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

Posted on 2004-09-29
5
638 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
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
Javatm earned 150 total points
Comment Utility
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
Comment Utility
0
 
LVL 12

Assisted Solution

by:Giant2
Giant2 earned 150 total points
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sumHeights2  challenge 7 75
Increment alphanumeric sequence 6 78
Java asynchronous logging 4 31
Java Jpanels and Jframe 8 19
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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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:

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now