[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 646
  • Last Modified:

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

Hi Experts,

    what kinds of function should I use in order to create a line, triangle, or polygon ? thanks.
0
meow00
Asked:
meow00
  • 2
2 Solutions
 
JavatmCommented:
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
 
JavatmCommented:
0
 
Giant2Commented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now