Results 1 to 4 of 4
  1. #1
    pj6444 is offline Senior Member
    Join Date
    Jan 2013
    Posts
    165
    Rep Power
    2

    Default Difference between paintComponent() and paint(_ methods?

    I'm just curious, what is the difference between using the paint() method and the paintComponent() method when you are doing 2D graphics. I've heard that it's better to use the paintComponent() method, but I have no idea why.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,651
    Rep Power
    5

    Default Re: Difference between paintComponent() and paint(_ methods?

    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    pj6444 is offline Senior Member
    Join Date
    Jan 2013
    Posts
    165
    Rep Power
    2

    Default Re: Difference between paintComponent() and paint(_ methods?

    Thank you very much!

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,651
    Rep Power
    5

    Default Re: Difference between paintComponent() and paint(_ methods?

    And I forgot this one. Painting in AWT and Swing
    It compares AWT painting with Swing painting.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Similar Threads

  1. Replies: 2
    Last Post: 11-07-2012, 01:33 PM
  2. Replies: 0
    Last Post: 11-07-2012, 11:49 AM
  3. paint and paintcomponent
    By wired-in=p in forum New To Java
    Replies: 3
    Last Post: 10-01-2011, 06:49 PM
  4. paint vs paintComponent for a JPanel
    By lightstream in forum AWT / Swing
    Replies: 4
    Last Post: 01-29-2009, 02:26 AM
  5. paint() and paintComponent()
    By goldhouse in forum Java 2D
    Replies: 1
    Last Post: 07-17-2007, 03:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •