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?