I'm having problems adjusting my combobox so it is closer to the 'band directory' label. How do i move the combobox to the left, just 5px besides the label. I have tried setting horizontal insets for my label and negative insets for my combobox but that still did not work.
Here is my code:
public void createGUI()
{
main_panel = new JPanel();
main_panel.setLayout(new GridBagLayout());
GridBagConstraints gc = new GridBagConstraints();
label = new JLabel("Band Directory:");
band_combobox = new JComboBox();
members_panel = new JPanel();
members_panel.setBorder(title);
members_list = new JLabel();
members_panel.add(members_list);
gc.fill = GridBagConstraints.HORIZONTAL;
gc.gridx = 0;
gc.gridy = 0;
gc.insets = new Insets(0, 0, 10, 0);
main_panel.add(label, gc);
gc.fill = GridBagConstraints.HORIZONTAL;
gc.gridx = 1;
gc.gridy = 0;
gc.insets = new Insets(0, 0, 10, 0);
main_panel.add(band_combobox, gc);
gc.fill = GridBagConstraints.HORIZONTAL;
gc.gridx = 0;
gc.gridy = 1;
gc.insets = new Insets(0, 0, 10, 0);
main_panel.add(members_panel, gc);
//more code
}
Try adjusting the overflow of the
members_panel
...