Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.11 seconds.

  1. Replies
    12
    Views
    2,582

    Re: Help with Object Looping

    And actually, you don't want to call super.paint each time through the loop. You only want to do that once at the very beginning of the method. And you should really be in a paintComponent method,...
  2. Replies
    12
    Views
    2,582

    Re: Help with Object Looping

    You are initializing w and h each time, inside the loop. That means they'll start at the same value each iteration. Look at how I initialized the variable (x in my first example) outside the loop, so...
  3. Replies
    12
    Views
    2,582

    Re: Help with Object Looping

    Well let's say I want to draw three circles in a row. All I'd have to do is update the x value as I draw them, right?
    Here's some pseudocode:

    int x = 20;
    for(int i = 0; i < 3; i++){
    ...
  4. Replies
    12
    Views
    2,582

    Re: Help with Object Looping

    That makes sense. I guess the question is: if you resize the window (make it bigger), do you want to draw the same number of circles, only bigger, or do you want to draw more circles the same size?...
  5. Replies
    12
    Views
    2,582

    Re: Help with Object Looping

    Do you know how many circles you want to draw? You should only need one for loop that loops once for each circle. You just need to update where you're drawing each circle each iteration.

    I'd...
  6. Replies
    12
    Views
    2,582

    Re: Help with Object Looping

    Well then post what you've done, no matter how incoherent, and we'll go from there. Don't forget the code (not quote) tags.
  7. Replies
    12
    Views
    2,582

    Re: Help with Object Looping

    What part are you having trouble with?

    The for Statement (The Java™ Tutorials > Learning the Java Language > Language Basics)
Results 1 to 7 of 7