Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

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

    please explain. Are you asking how to use an Iterator?
  2. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Good luck with your project. I guess you have lots of decisions and coding to do to work thru your wish list.
    Come back if you have any specific problems or questions.

    A suggestion:
    Pick ONE of...
  3. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Can you show what you are talking about? Give each layer you are printing an easily named color: Eg RED, CYAN, BLUE, YELLOW and then describe the problem by saying I want the RED layer on top of the...
  4. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Which is drawn first and which last?
  5. [SOLVED] Re: How do you get this fountain to animate with paint method?

    how do you want the droplets to move. Along a line or randomly?

    The listener does not do any drawing. It computes the next location at which to draw.
    The paintComponent method uses that location...
  6. [SOLVED] Re: How do you get this fountain to animate with paint method?

    draw it at a x,y location. The code executed at next call to the Timer listener will change that x,y location to a new value and call repaint which will go back to the beginning of this sentence and...
  7. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Go back to your simple program and work on it.

    Why?
    Did you do that in your simple program?
    Did your simple program work as expected?
  8. [SOLVED] Re: How do you get this fountain to animate with paint method?

    for (int x = 325; x < 352; x++)
    {

    for (int y = 125; y < 155; y++)
    {
    xLoc = x;
    yLoc = y;

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

    Your changes to x and y are to radical to look like motion. Think of a better way to have a slow random motion.
  10. [SOLVED] Re: How do you get this fountain to animate with paint method?

    I recommend that you write a simple drawing program (a Frame with a Panel). Have the paint method in the panel draw a circle at some location. Add a Timer and have the listener code change the...
  11. [SOLVED] Re: How do you get this fountain to animate with paint method?

    For animation you need to change the drawing every few time units. The Timer controls your code being executed every few time units. The code called as the Timer listener needs to change the values...
  12. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Explain what your code is NOW doing that will make it animated?

    I assume that animation means showing things differently over time.
  13. [SOLVED] Re: How do you get this fountain to animate with paint method?

    What message?

    Explain what your code is NOW doing that will make it animated?
    Is it using a Timer?
  14. [SOLVED] Re: How do you get this fountain to animate with paint method?

    You have to redraw everything every time if you clear the panel each paint.
  15. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Copy the example code from the tutorial and make a small program from it. Have the action listener print out a message to show when it is executed.
    If you have problems copy the code here with your...
  16. [SOLVED] Re: How do you get this fountain to animate with paint method?

    You don't.
    Call repaint which will cause paintComponent to be called.
    Do your drawing there.
  17. [SOLVED] Re: How do you get this fountain to animate with paint method?

    For Timers read this:
    How to Use Swing Timers (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Other Swing Features)
  18. [SOLVED] Re: How do you get this fountain to animate with paint method?

    You don't. You compute the values that control what is to be drawn, then call repaint().
    When the paint method is later called by the JVM it uses the computed values to make the drawing.
  19. [SOLVED] Re: How do you get this fountain to animate with paint method?

    You can create a new inner class and make it the listener
  20. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Look at the API doc and you'll see how many there are.
  21. [SOLVED] Re: How do you get this fountain to animate with paint method?

    Do you really write code without any indentations? Or is there some problem with the way you copy and paste your code on the forum?
Results 1 to 21 of 21