Setting a gradient on a Master JPanel made of sub JPanels
john kalaigian
Greenhorn
Joined: Nov 20, 2001
Posts: 15
posted
0
I would like to use a gradient as a eye pleasing background for a JPanel that I have (very much like the search entry panel used in Limewire). I have one main Class that extends JPanel with a paintComponent method in it which handles the gradient painting. The problem is that when i start adding what I call sub JPanels onto the extended JPanel (this) I don't see the gradient painted on those particular panels. Why is that - and another question is can i implicitly call paintComponent(Graphics g) without extending the JPanel class. I'm afraid I don't quite see how paintComponent(Graphics g) is implicitly called in the background, although I understand that it as well as paint are already part of any AWT Component. Thanks in advace, John