Search:

Type: Posts; User: Norm

Search: Search took 0.09 seconds.

  1. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    The code you posted has to be rewritten.
  2. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    Make a SSCCE to show the problem.
    You will probably need separate panels for the buttons and the drawing area.
  3. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    Good luck rewriting the code.

    Try to use Swing classes instead of the older AWT classes you are using.
  4. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    You should be able to see how drawing works now. You'll have to rewrite your code.
  5. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    I don't see it in post#23. Where is it? I do NOT find it when I search the posted text.
  6. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    Where did you do this:
    set the size of the MovePingPong frame and make it visible.
  7. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    I made the changes I suggested in post #20 and added this one extra line to the new paint method:
    b.DrawCircle(g);

    This causes a circle to move around in the MovePingPong frame.
  8. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    No. I don't see an override of the paint method in that class.
    The JFrame that MovePingPong extends is never set visible nor does it have any components added to it.
    Add a paint method to...
  9. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    A bit of rewriting. Use the timer to call you code that sets the new/next position of the shape, calls repaint and exits. In the paint method draw the shape at the new location.
    Next timer call to...
  10. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    You do not override any paint methods. That is the method that the JVM will can after you call repaint.

    I've never seen your technique for animation. There are dozens of code samples on the forum...
  11. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    Can you make ONE source that compiles and executes and shows the problem. You have posted at least 4 so far. One source that shows the problem would be bettter.
  12. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    The code you just posted does not compile. I get these errors:


    TestMenu.java:12: cannot find symbol
    symbol : class Picture
    location: class TestMenu
    private static Picture pic;
    ...
  13. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    Please make a small simple program (SSCCE) that compiles, executes and shows your problem.

    Please Edit your post and wrap your code with

    <YOUR CODE HERE>
    to get highlighting and preserve...
  14. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    Please make a small simple program (SSCCE) that compiles, executes and shows your problem.

    Please Edit your post and wrap your code with

    <YOUR CODE HERE>
    to get highlighting and preserve...
  15. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    The first thing I see is two classes that extend Frame.
    What are the two frames for?

    The code does not compile. Several classes are missing. Impossible to test unless the code compiles and...
  16. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    I am assuming that you have listeners for the buttons.

    If your code does not use listeners, then I have no idea how it is working.
    Can you post your code so we can see how it works?
  17. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    Basically you need to return/exit from your listener method code after you call repaint.

    Here are links with some of the terms defined:...
  18. Replies
    33
    Views
    3,791

    Re: repaint() event does not work.

    Does the method that calls repaint() return control to the JVM so that it can call the paint method?
    If your code is using the JVM's GUI/EDT thread like in a listener, the JVM will queue the calls...
Results 1 to 18 of 18