Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Repaint,

  1. #1
    Member
    Join Date
    May 2010
    Posts
    39
    Thanks
    4
    Thanked 3 Times in 3 Posts

    Default Repaint,

    Any idea why the repaint method wont repaint the the frame some times when called?

    Like a list of reasons,


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Repaint,

    A simple list, but there are probably an unlimited number of reasons:
    1. You have a subclass that over-wrote the default re-paint method and no painting is done in this method
    2. There is no reason to repaint
    3. You over-wrote the update method to not call repaint

  3. #3
    Member
    Join Date
    May 2010
    Posts
    39
    Thanks
    4
    Thanked 3 Times in 3 Posts

    Default Re: Repaint,

    Quote Originally Posted by helloworld922 View Post
    A simple list, but there are probably an unlimited number of reasons:
    1. You have a subclass that over-wrote the default re-paint method and no painting is done in this method
    2. There is no reason to repaint
    3. You over-wrote the update method to not call repaint
    Well yea, I was asking because I had a problem before (Now fixed)

    The "repaint" wasnt doing anything, (I was like what the hell)

    I ended up just doing paint(getGrahics()); and it worked,

  4. #4
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: Repaint,

    Wrong approach. Never use getGraphics of a component in client code. This approach cannot and will not work consistently.

    To get better help sooner, post a SSCCE *
    * SSCCE : Java Glossary

    db

Similar Threads

  1. Repaint doesn't repaint?
    By PotataChipz in forum AWT / Java Swing
    Replies: 6
    Last Post: January 18th, 2010, 09:56 PM
  2. Replies: 1
    Last Post: October 23rd, 2009, 03:17 PM