Incorrect position of Swing components
问题 I woud like to have button btn at the bottom of a JFrame . I have this in right side. Where is bug in my code? class MainClass extends JFrame { private JSplitPane splitPan=null; private void treePanel(){ DefaultMutableTreeNode nod=new DefaultMutableTreeNode("AAA",true); nod.add(new DefaultMutableTreeNode("abcd")); JTree tree=new JTree(nod); JScrollPane scroll=new JScrollPane(tree); splitPan=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,scroll,new JLabel("aaaaa")); splitPan.setSize(this