I am trying to set the preferred width for jscrollpane in borderlayout (WEST). but it does not work
Please check out my sample code.
JTree tree=new JTree(root); JScrollPane jsp=newJScrollPane(tree); jsp.setBounds(0,0,200,100); Jframe.add(jsp,BorderLayout.WEST);
but it shows the default width.
As an alternative, I tried setting the preferred size for JTree, it works fine, but jscrollpane does not work properly. Please help me with this.
source share