Well, I've never used GeneralPath, but it looks like one reasonable procedure would be to construct one with the default constructor, then use moveTo() to set one corner of the triangle, then use lineTo() to trace out the lines. Then, as GeneralPath implements Shape, you can just pass the GeneralPath to the Graphics2D.fill() method to draw it.
Two tips: don't override paint() in a Swing component. Override "paintComponent()" instead, and always call super.paintComponent() inside your implementation. Finally, don't try to draw right on a JFrame; draw on a JPanel, and add the JPanel to your JFrame.
I'm going to move this to the
Swing forum. [ February 06, 2004: Message edited by: Ernest Friedman-Hill ]