Curve

If your browser is not Java-enabled, this page will look very boring. This applet was compiled with the beta 1.0 release of Java, so will not be viewable with HotJava.

Instructions

Use the radio buttons at the bottom of the applet to select the curve-point mode. In add mode, clicking on the display will add a curve control point. In delete mode, when you click on a control point, it will be removed. In move mode, you can click and drag control points.

When there are enough control points (4 or more), they will be used to plot a curve of the selected type. Select the curve type from the radio buttons on the top of the applet. The clear button will remove all the control points. This applet is a port of a MS-Visual Basic application.

Precision Scrollbar

If any of you looked at my old code, you would have found hooks in the code to add the ability to control the precision of the curve. I finally got around to looking at how scrollbars work in Java, and here it is. The most difficult part of adding a scrollbar is knowing that Scrollbar events are not ACTION_EVENT's, and cannot be handled from the action() method. Put all the event handlers in the handleEvent() method, and everything works great.


Return to Drawing a curve