Search:

Type: Posts; User: pbrockway2

Search: Search took 0.16 seconds.

  1. [SOLVED] Re: Help with my Java program: Applet that draws 5 random circles.

    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...
  2. [SOLVED] Re: Help with my Java program: Applet that draws 5 random circles.

    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...
  3. [SOLVED] Re: Help with my Java program: Applet that draws 5 random circles.

    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...
  4. [SOLVED] Re: Help with my Java program: Applet that draws 5 random circles.

    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...
  5. [SOLVED] Re: Help with my Java program: Applet that draws 5 random circles.

    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...
Results 1 to 5 of 5