Declaring a variable and giving it its first value all on one line is quite common in Java. (and similar languages). In this case not in main() - because it's an applet.
Did you look at the...
Type: Posts; User: pbrockway2
Declaring a variable and giving it its first value all on one line is quite common in Java. (and similar languages). In this case not in main() - because it's an applet.
Did you look at the...
Yes - resize, minimise/maximise, obscure/uncover... These will all cause the applet to paint itself. So if the code that positions and sizes the circle is in the paint() method you will get another...
Just wondering, but won't the code draw a randomly positioned and sized circle every time it repaints itself? This can happen many times over the life of a component.
Eg with your code I see a...
Sorry, by "goldilocks" I just meant one that would not be too big, nor too small. "generator.nextInt(75)+25" looks good.
And yes, double the radius to get the width and height. So if...
drawOval() actually takes four arguments: x, y, width and height. It is the last two that relate to the circle's radius. Imagine a circle of radius r inside a tightly fitting square box. It should...