Try subclassing the JPanel and then overriding the paintComponent(Graphics g) method. Make sure you call super.paint() somewhere, or just paint your components (the JPanels and JFrames) yourself by calling their paint(g); method with the graphics you get.
public void paintComponent(Graphics g)
{
g.drawImage(0, 0, this.getSize().width, this.getSize().height, this);
ArrayList list = myOwnComponentArrayListIDefinedAndFilledSomewhereElse;
for (i = 0; i < list.size(); i++)
{
((Component)list.get(i)).paint(g);
}
}
Hope this helps - I think there'll be a way more elegant solution for drawing the subcomponents somewhere out there...
allow thyself to be the spark that lights the fire
haslo@haslo.ch - www.haslo.ch
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.