Search:

Type: Posts; User: javapenguin

Page 1 of 2 1 2

Search: Search took 0.11 seconds.

  1. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Well, I actually made my own HashSet class that used my old DoublyLinkedList object, basically my own Linked List class, as an object and added to it only if, by using the equals() method, none of...
  2. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Well, I figured out that I had called some of the code in the paint method itself and before I drew the sidewalk so that's why it kept getting drawn over.

    So I think I've got it for now.

    May...
  3. [SOLVED] Re: How do you get this fountain to animate with paint method?

    No, an ArrayList would be better. Right now it'll be running into Null Pointer Exceptions, but how to....., hmmmm...

    is it possible to make a Point or something as a HashSet?

    Yes, that's what...
  4. [SOLVED] Re: How do you get this fountain to animate with paint method?

    How did you get to be a forum VIP?

    aussiemcgr appears to be one too.

    I want the drops to appear at the previous stages so that the drops will appear always moving down.

    After starting,...
  5. [SOLVED] Re: How do you get this fountain to animate with paint method?

    3D Rect drawn first.

    I figured that would work as I had noticed that if, for instance, I called drawOval() with a black outline and then called fillOval() say with blue shape, it would only show...
  6. [SOLVED] Re: How do you get this fountain to animate with paint method?

    I got it to animate a droplet and finally figured out that I needed to reset my counter of the times it was called it 0 so that the droplet would move back to the start again.

    How do I get more...
  7. [SOLVED] Re: How do you get this fountain to animate with paint method?

    How would I do that without using a Random?

    Should I use some kind of counter variable that will keep track of how many times listener is called and have a bunch of if and else if statements...
  8. [SOLVED] Re: How do you get this fountain to animate with paint method?

    The simple program did move the Circle every half second like I told it to and had about 3 seconds of initial delay.

    No, I did not restart the Timer in my simple program.

    However, I used...
  9. [SOLVED] Re: How do you get this fountain to animate with paint method?

    An equation that makes the circles x2 + y2 = r2;
    x >=0 and y >=0 that starts at point(0, r) and ends at point (r,0) might work, but how do I set that up?

    Also, should I be restarting the Timer...
  10. [SOLVED] Re: How do you get this fountain to animate with paint method?

    I tried it on the other one and it won't work quite, though there is a change. It got rid of all the black stuff that had been drawn there before.
    But it's still not animating.


    import...
  11. [SOLVED] Re: How do you get this fountain to animate with paint method?

    I did an it worked. Now how do I do it for this one?

    Same way?

    This time though I don't want to just have the water appear at random places. So I don't need a Random object like I did in my...
  12. [SOLVED] Re: How do you get this fountain to animate with paint method?

    You're saying that my Timer should take some int values or whatever and change them and then have those values be also used in the paintComponent() method?

    That kinda looked like what they were...
  13. [SOLVED] Re: How do you get this fountain to animate with paint method?

    I thought that this code in the paintComponent() might do it:


    public void animateFountain(Graphics g)
    {
    int newRed = Color.BLUE.getRed() + 10;
    int newGreen =...
  14. [SOLVED] Re: How do you get this fountain to animate with paint method?

    What code? The AcfionListener or the paintComponent()?

    I told it to print "Execute now" or something like that and it does every 1 or 2 (probably 2) seconds.


    import java.awt.*;
    import...
  15. [SOLVED] Re: How do you get this fountain to animate with paint method?

    I did. I printed the message but still isn't doing what I wanted animation-wise.

    By any chance should the Timer be an object of the class that is the Object I'm painting to, i.e. my...
  16. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Ok, so I have yet another problem though. I think I may have it drawing everything inside paintComponent() yet I only want the water to move (may add more animation later once I get this part to...
  17. [SOLVED] Re: How do you get this fountain to animate with paint method?

    I was able to get something that looked like crude animation, not what I wanted, when I called getGraphics() inside the ActionListener that the Timer uses, but you told me not to do this.

    Also,...
  18. [SOLVED] Re: How do you get this fountain to animate with paint method?

    I read it. However, how do I get the code to draw things using Graphics inside an ActionListener if I can't use getGraphics()?
  19. [SOLVED] Re: How do you get this fountain to animate with paint method?

    I can't run the call to MyThread inside the main method as it keeps saying "non-static variable this cannot be referenced from a static context".

    Why won't it work? I don't know how to work a...
  20. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Ok, now it did something weird and drew more of my foundation again a bit upward. Sorta made a transpose but still kept the old one.

    It's an improvement a little bit, but the fountain won't...
  21. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Should I use a Swing Worker, whatever that is, too?
  22. [SOLVED] Re: How do you get this fountain to animate with paint method?

    So I use the paint method for the inner class for repaint()?

    If I'm using the regular repaint(), that will likely repaint the entire image and that's not what I want it to do, just the fountain...
  23. [SOLVED] Re: How do you get this fountain to animate with paint method?

    But if I had an ActionListener, which I'd need to make a Timer object, then should I add some ActionListener to the JPanel or something then?
  24. [SOLVED] Re: How do you get this fountain to animate with paint method?

    I was able to get words to move across the screen with just this simple code. I didn't use a Swing Timer or anything like that.


    import java.lang.Thread;
    import java.awt.*;
    import...
  25. [SOLVED] Re: How do you get this fountain to animate with paint method?

    I usually do, though I can easily indent it.

    Anyway, I was looking at another thing where I got some words to move to random places across a screen and I used a Thread method.

    Should I do...
Results 1 to 25 of 26
Page 1 of 2 1 2