Hello im implementing my firs split pane view and it doesn’t seem to be working for me and i get the following output…

Here is the code.
//Create Album Panel
albumPanel.setLayout(new FlowLayout());
//Add List view
albumList.setMinimumSize (new Dimension(150,150));
albumPanel.add(new JScrollPane(albumList));
//Add Text Area
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true);
textArea.setEditable(false);
textArea.setMinimumSize (new Dimension(150,150));
albumPanel.add(textArea);
//Split Pane
JSplitPane splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, albumList, textArea);
albumPanel.add(splitpane, BorderLayout.CENTER);
You have set your
albumPanellayout toFlowLayoutbut you try and use aBorderLayoutconstants when adding to theJSplitPane:albumPanel.add(splitpane, BorderLayout.CENTER);you should rather set the
albumPanellayout toBorderLayoutvianew BorderLayout()Also it is not a good idea for you to set the size of your components let the
LayoutManager‘s do it for you.