Search:

Type: Posts; User: Spidey1980

Search: Search took 0.08 seconds.

  1. Re: Challenge: I need an animation loop outside of the paint method.

    It did work, how ever my code has been polished and the random generators are now in the constructor. Infact new values are no longer created like that, myX, myY, ect only get values set to them...
  2. Re: Challenge: I need an animation loop outside of the paint method.

    they do get in there though. the random numbers get to the constructor because I did not declare them private. I was having a problem using the random in the constructor because my star.class was...
  3. Re: Challenge: I need an animation loop outside of the paint method.

    validate(); has the same result as repaint();
  4. Re: Challenge: I need an animation loop outside of the paint method.

    complete code so far:

    StarScape.java

    // starscape.java
    // by Jon Crawford
    import Star.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
  5. Re: Challenge: I need an animation loop outside of the paint method.

    That's better... I had forgot java wants two constructors:



    public Star()
    {
    for (int num = 0;num < 9; num++)
    {
    starField[num] = 0;
    }// end for
  6. Re: Challenge: I need an animation loop outside of the paint method.

    lol and yet it works. I did not want to become a hacker....

    and when I remove the void it tells me I forget to add a return.

    Is this because I forgot to put in a default constructor, and I just...
  7. Re: Challenge: I need an animation loop outside of the paint method.

    They are being passed, your only seeing half the code here. It does work I assure you, I just want to make it so it is not system crippling.

    The constructor:


    public void Star(double myX,...
  8. Re: Challenge: I need an animation loop outside of the paint method.

    Thought that was calling the constructor

    I still have more reading to do on threads, I gotta go to work soon so I'm leaving that till tonight

    lol doIt should be converted to a thread i guess.
    ...
  9. Re: Challenge: I need an animation loop outside of the paint method.

    how do I force a repaint?
  10. Re: Challenge: I need an animation loop outside of the paint method.

    I thought
    stars[index] = new Star();//fill array with stars
    was calling the consrtuctor
  11. Re: Challenge: I need an animation loop outside of the paint method.

    okay it sort of works. I have to keep resizing the window to see the animation. Is there a way to make it run on it's own without the need to resize the window to see the next frame?

    here is the...
  12. Re: Challenge: I need an animation loop outside of the paint method.

    Thank you. I will post back after some re-coding.
  13. Re: Challenge: I need an animation loop outside of the paint method.

    unless they need a for loop.

    I'm not gonna Star1..Star2....Star1000. on 1000 different lines


    Can repaint be called outside of a thread, yet inside a method? (is using a thread absolutely...
  14. Re: Challenge: I need an animation loop outside of the paint method.

    so in other words, the paint method should just loop through the total number of stars one time, moving each star one time. then in the do...while some where else a repaint() will call the paint...
  15. Challenge: I need an animation loop outside of the paint method.

    I am confused as to this point. I just spent 4 hours last night trying to put the animation loop of my StarScape outside of the paint method so that my code does not cripple the system, and have hit...
Results 1 to 15 of 15