A simple two column layout with Swing

Posted by Derk on Stack Overflow See other posts from Stack Overflow or by Derk
Published on 2010-04-06T13:39:13Z Indexed on 2010/04/06 13:43 UTC
Read the original article Hit count: 283

Filed under:
|
|

How to get a sidebar JPanel of a fixed with with Swing. Now I'm trying this:

public SidebarPanel() {
    this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));   
    this.setPreferredSize(new Dimension(200, this.getPreferredSize().height));
    ...

But when I resize the window also the width of the sidebar changes. How to fix this?

© Stack Overflow or respective owner

Related posts about java

Related posts about swing