I need to know how to create a triangle, and how to fill it with color. I am new to programming and would appreciate the help. I am not running the applet in a web browser, just executing it. Thanks.

This should get you started. I hope you will realize you need a little more than that but you can probably figure it out.

int [] xcoords = { 1,2,3,1}   // example
int [] ycoords = {1,2,3,1 }   

Polygon triangle = new Polygon(xcoords,ycoords,number of points);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.