Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Peter Cheung Newsgroups: comp.lang.java.programmer Subject: can't stop JPanel paint Date: Thu, 14 Jul 2011 04:43:04 -0700 (PDT) Organization: http://groups.google.com Lines: 40 Message-ID: <728e86bb-daed-40cd-b8a2-d2bf08059dd5@glegroupsg2000goo.googlegroups.com> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 76.79.177.154 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1310643901 24481 127.0.0.1 (14 Jul 2011 11:45:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 14 Jul 2011 11:45:01 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.79.177.154; posting-account=10LjMwkAAAAVcy8G3B3qqGRpk0olXjxD User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6186 Hi I have overrider all the paintXX method and did nothing in there. But why I still able to see the component on top of the JPanel? thanks from Peter (cmk128@hotmail.com) import java.awt.CardLayout; public class Carousel extends JPanel { public Carousel() { setLayout(new CardLayout(0, 0)); b.setSize(100, 100); } public Component add(Component c) { add(c, ""); return c; } public void paint(Graphics g) { } public void paintComponents(Graphics g) { } public void paintChildren(Graphics g) { System.out.println("ss"); } public void paintImmediately(int x, int y, int w, int h) { } public void paintImmediately(Rectangle r) { } public void repaint(long tm, int x, int y, int width, int height) { } }