Re: To use paint or paintComponent?




travel2light wrote:
Which is the right one to use for Swing components? I have always used
JPanels with a method paint(Graphics g) and then just called that
method using 'repaint()'. But after reading some of the discussions
here I found out that the correct way to go is to use
paintComponent(Graphics g). Why is this? What is the difference
between the two methods? Thanks for any advice.

Michael

<http://java.sun.com/products/jfc/tsc/articles/painting/index.html#callbacks>
<http://java.sun.com/products/jfc/tsc/articles/painting/index.html>


.



Relevant Pages

  • To use paint or paintComponent?
    ... Which is the right one to use for Swing components? ... JPanels with a method paintand then just called that ... But after reading some of the discussions ... Thanks for any advice. ...
    (comp.lang.java.gui)
  • Re: To use paint or paintComponent?
    ... JPanels with a method paintand then just called that ... But after reading some of the discussions ... I could not understand what the new scheme bought them. ... Roedy Green Canadian Mind Products ...
    (comp.lang.java.gui)