custom GUI

hi I need to know how to make custom GUI components such as a triangular button.

From what i have read a forum, a guy told me I might not wish to use Java’s inbuilt GUI components and write specialized controls from scratch using the most basic Window control like basic Window-Handles in C++ for example.

so can anyone help by providing a simple coded example of how to build a triangular button from sratch.

;D

Subclassing JButton to paint a triangle (override paintComponent()) and then override contains(int x, int y) I think will get you there, but I’m not sure.

The more ?robust? way to do it is via a ButtonUI and install that (there are tutorials on Sun’s site). This would make all buttons in your new look&feel look and feel like a triangle.

Cheers,
Mikael

Check out this tech tip
http://java.sun.com/developer/TechTips/1999/tt0826.html