I want to add a vertical JSeparator between two components using a GridBagLayout. The code I have is as follows:
public MainWindowBody(){ setLayout(new G
You could try to set the preferred width for the separator:
sep.setPreferredSize(new Dimension(5,1));
Then, make GridBagLayout use up all available height for the separator:
gbc.fill = GridBagConstraints.VERTICAL; gbc.weighty = 1;