apply JPanel at runtime

Hi there. I want to make an instans of a JPanel at runtime and apply it (and get it drawn on the sreen) but it doesnt work for me.. I have a button and when it is pushed I want to create a new JPanel and apply this to the backframe. Is this possible at all?

I realy hope you can help me.. thanks a lot in advance :)

[329 byte] By [Ruby777a] at [2007-11-26 21:05:13]
# 1
make sure after you add the panel you call the following on the parent of the added panelrevalidate()-or-invalidate()validate()then, if you want to resize your window,Frame/Dialog.pack();thenrepaint()
tjacobs01a at 2007-7-10 2:38:44 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thanks a lot.. you really saved my day :)
Ruby777a at 2007-7-10 2:38:44 > top of Java-index,Desktop,Core GUI APIs...