aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Panel on Splitpane: Fully occupy the Pane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Panel on Splitpane: Fully occupy the Pane" Watch "Panel on Splitpane: Fully occupy the Pane" New topic
Author

Panel on Splitpane: Fully occupy the Pane

Karen Baog
Ranch Hand

Joined: Mar 02, 2005
Posts: 120
I need some help with the placement of this component.
What I need is to place this panel to fully fit in the JFrame.
Also, when the JFrame is resized this panel will also resize, so does the JList.
This panel is added to a spiltpane, but it only appears in the center and not fully occupy the allocated pane.

Here�s the snippet of the relevant code.



amerzil co-ed student<br />"Praise be the Code"
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

The panel is probably laying out fine. It's the JList that might be visually confusing as to what the component is doing. Try setting a layout of BorderLayout on the JPanel (P) and adding the scroller to it with BorderLayout.CENTER.


GenRocket - Experts at Building Test Data
Karen Baog
Ranch Hand

Joined: Mar 02, 2005
Posts: 120
OK. I'l try that out. But how about this JPanel to still fully occupy its pane in the splitpane when the JFrame is resized?
Karen Baog
Ranch Hand

Joined: Mar 02, 2005
Posts: 120
And in addition to the resizing problem how do I get the JList to wrap the text?

Thanks to all you guys for your help.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Panel on Splitpane: Fully occupy the Pane