[Menu]>[Java Programming]>[Production samples by JDK1.0]


Diamond diagram Applet





This applet is the applet that depicts the geometrical pattern of the circle.
Although this might not be so practical,
it made for the practice because it is interesting.

The point of this applet is to use Math.cos and also Math.sin object.
The trigonometrical function is used to calculate the start point and completion point when draws the line.
Math.random object is used to decide the color of the line,
and the random color has been produced.
Therefore, the color of the line changes the every time that depicts it.

As it understands to depict the line, the time interval when draws the line is being set up.

The function is as follows.
The input parameter is decreasing as much as possible.

The radius of the circle that depicts is possible designated.
The node number that depicts is possible designated.

The following function is as fixation to avoid the complicatedness of input.
If the source program is changed, it is able to change.
The color of the background is fixing to white.
The time interval when depicts the line is setting up to 20mSEC.
( It differs with the performance of PC )
The color of the line is deciding to the random by the rebellion number.
The interval of the display color is setting up in 2 seconds.
The position where displays calculates be automatic
and be doing at the center of the display area.
The left end or the upper end are being fixed
in the case of the circle of the size which is not able to display.

The size of Diamond.class becames 3.00KB.

Designated method in HTML

Source program list


The drawing of the line may be skipped( Color of the line of before remains ) by processing timing.
Is it to fail when the paint method is triggered from the run method?
Also, the first line is not depicted in NN3.0, NN4.0.
It is drawn normally in IE3.0 and also IE4.0.
Why is it?
My bug? The bug of NN?
It might not correct to process with the combination of the run method and paint method.
Or, writing twice does it?


The source program list can utilize by copying to notepad etc.

Copy method