Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

paintComponent() problem

 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thaks a lot Craig, that really worked!

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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic