Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3276

To use paint or paintComp

From "travel2light" <travel2light@THRWHITE.remove-dii-this>
Subject To use paint or paintComp
Message-ID <0fec8bfb-bf04-4384-82f2-2ffdcbcd4e11@s12g2000prg.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
Date 2011-04-27 15:43 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
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

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar | Unroll thread


Thread

To use paint or paintComp "travel2light" <travel2light@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
  Re: To use paint or paint "Jeff Higgins" <jeff.higgins@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
  Re: To use paint or paint "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
    Re: To use paint or paint "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:44 +0000

csiph-web