Article View: borland.public.jbuilder.java.swing
Article #9479Set background after extending JPanel?
From: Trey Ethridge
Date: Mon, 27 Mar 2000 00:00
Date: Mon, 27 Mar 2000 00:00
16 lines
1204 bytes
1204 bytes
Hello all, I'm trying to use the Graphics2D api to draw some simple shapes on a class that I extended from JPanel. I'm want to set the background in my object, but I have been unable to get it to work. I've tried using super.setBackground(Color.white) from within my class. I have overloaded the paintComponent() method in my class and I don't know if that has anything to do with it. I know that when I comment out the paintComponent() method it paints the background correctly. However, it's my understanding that I have to overload the paintComponent() method to draw my shapes with the Graphics2D api. Can anyone help me with this? Trey
Technical Details
Message-ID:
<38DF8772.DE6AFEF6@softrealityinc.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,e8ac0b4dbbc13ca5,start X-Google-Attributes: gid111d45,public From: Trey Ethridge <ethridge@softrealityinc.com> Subject: Set background after extending JPanel? Date: 2000/03/27 Message-ID: <38DF8772.DE6AFEF6@softrealityinc.com> X-Deja-AN: 602995914 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing