Trying to create a JSplitPane with two JPanels. With the following code:
JTable table = new JTable(qualifierModel);
table.setDefaultEditor(String.class, new QualifierCellEditor());
JPanel qualiferPanel = new JPanel();
JScrollPane jp = new JScrollPane(table);
qualiferPanel.add(new JLabel(Translator.getText("Select one qualifier for each section # from the table.")));
qualiferPanel.add(jp);
qualiferPanel.setVisible(true);
JToolBar btnBar = new JToolBar();
btnBar.setFloatable(false);
btnBar.add(Box.createHorizontalGlue());
btnBar.add(addItemButton);
btnBar.add(removeItemButton);
setLayout(new BorderLayout());
profilePanel.add(new JScrollPane(profileTable), BorderLayout.NORTH);
profilePanel.add(btnBar, BorderLayout.SOUTH);
JSplitPane spane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
spane.setTopComponent(profilePanel);
spane.setBottomComponent(qualiferPanel);
setLayout(new BorderLayout());
add(spane,BorderLayout.CENTER);
I have added two add buttons in the first JPanel which is not visible. How should I adjust the size of the first JPanel.