Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes paintComponent() problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "paintComponent() problem" Watch "paintComponent() problem" New topic
Author

paintComponent() problem

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
I wrote code for a paintComponent(Graphics g) and this code paints a gradient on a jPanel background;

Using eclipse, i've several panels (each inside a JTabbedPane) and this makes no one show the expected background.
i tried a variety of opaque and non opaque combinations involving JTabbedPane, contentPane and Panels, but without any effect...

Where should i put my method?
How can i have all jPanels have that gradient effect?

TiA


java amateur
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
thaks a lot Craig, that really worked!

implementing the refered method as an anonimous inner class and add it a call to super

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: paintComponent() problem
 
Similar Threads
TwoButtons App From "HeadFirst Java" Book
Setting a gradient on a Master JPanel made of sub JPanels
jButton fill colour
Gradient Background for JTextPane
JTextAreas Look & Feel