Drawing lines and shapes
The applet below is a DrawSelector. Select the type of shape
you want to draw from the pulldown list below.
Press the "Go" button to start and the "Stop" button to stop.
DrawSelector
So this applet shows what sort of graphics can be done with Java
and how fast those operations are.
There is certainly room for improvement.
For example, the drawing surface used should really have been a
subclass of a Java Canvas, and the buttons should be
greyed out at the right times, but on the whole this does the
job it was meant to do. Later on, more consideration will be given to user interfaces.
In the words of a sagging grey-haired well known sports
personality (over there), How do they do that?
- DrawSelector. contains some
standard user interface widgets that control a DrawSelectorCanvas
- DrawSelectorCanvas. The
animated drawing surface that draws the lines. The animated
behaviour is inherited from ThreadedCanvas.
- ThreadedCanvas. The real workhorse
This manages the offscreen bitmap needed for animated behaviour.
file: /Techref/language/java/nosugar/graphics/draw/index.htm,
1KB, , updated: 1997年6月1日 20:42, local time: 2025年9月22日 16:55,
©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Questions?<A HREF="http://massmind.org/techref/language/java/nosugar/graphics/draw/index.htm"> Learning Java [lines and shapes]</A>
Did you find what you needed?
Welcome to massmind.org!
Welcome to massmind.org!
.