Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dock JPanel in JPanel

843806Jun 13 2009 — edited Jun 15 2009
Good afternoon,

I'm trying to add JPanelA to JPanelB and make JPanelA completely fill the JPanelB (docking in VB.NET). Both panels use the FreeDesign Layout

After I add JPanelA I'm calling a method on it which does the following:
    public void DockInParent()
    {
        this.setBounds(this.getParent().getBounds());
        this.setSize(this.getParent().getSize());        
    }
JPanelA just isn't expanding to fill the bounds of its parent.

I know there must be a really simple way to do this. Can someone please give me a nudge in the right direction?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2009
Added on Jun 13 2009
5 comments
523 views