Hi,

I wanted to put my toolbar in a GridBagLayout for I can put a ComboBox that
doesn't stretch to the end of the program.

This is what I have:

JLabel eventsLabel = new JLabel("Events:", SwingConstants.LEFT);
comboEvents = new JComboBox();
comboEvents.setEditable(false);
comboEvents.addItem("Test");

GridBagLayout eventLayout = new GridBagLayout();
toolbar.setLayout(eventLayout);
GridBagConstraints constraints = new GridBagConstraints();

constraints.fill = GridBagConstraints.NONE;
constraints.anchor = GridBagConstraints.EAST;

constraints.weightx = 0;
constraints.weighty = 0;
constraints.gridx = 0;
constraints.gridy = 0;
constraints.gridwidth = 0;
constraints.gridheight = 0;

toolbar.add(comboEvents, constraints);

JLabel groupsLabel = new JLabel("Groups:", SwingConstants.LEFT);
comboGroups = new JComboBox();
comboGroups.setEditable(false);
comboGroups.addItem("Test");

toolbar.add(eventsLabel);
toolbar.add(comboEvents);
content.add(toolbar, BorderLayout.NORTH);

I added the ComboBox to the toolbar twice, that seemed to put it to the far
right of the buttons instead of it being underneath the last ones.

Right now with this code it puts all items in the toolbar in the center;
I would like to have it to the east.

I'm probably just going at this the wrong way.

Also is there a way to get which control (combo box, etc) has focus?