import java.applet.Applet; import java.awt.*; /*The new feature of this applet is that it draws a triangle, in addition to some words.*/ public class test1 extends Applet { public void init() { setBackground(Color.black); } public void paint(Graphics g) { g.setFont(new Font("Helvetica",Font.PLAIN,40)); g.setColor(Color.yellow); g.drawString("Rich: Applet 2",10,40); /**draw the triangle**/ g.setColor(Color.red); int x[]={100,100,200}; int y[]={100,200,200}; g.fillPolygon(x,y,3); } }