5.6, 6.8
5.6
1.
To scale the panel size to the image displayed, use the getPanelWidth() and getPanelHeight() functions
2.
Circle(double x, double y, double r, Color c)
double z = scanner.nextDouble()
void setRadius(double z)
3.
for detecting mouse motion, the method MouseMotionAdapter is used.
for detecting mouse clicking, the method MouseAdapter is used.
6.8
1.
to set up a timer, you must use the methods start and actionPerformed. The timer counts time from when it starts, and when its interval of time passes, it activates the actionPerformed method. The timer is used to do certain things at regular intervals.
2. A rapid display of successive frames allows us to see moving graphical images.
3. Flicker is caused by the speed of the display medium with large, fast moving images. Slowing down the image would reduce flicker.
4. The direction and velocity of an object can tell you where it will be placed after a period of time, and can be tracked with certain functions. You can also tell the circle to move according to its velocity and direction with void move().
Loading...