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();
GridBagLayout eventLayout = new GridBagLayout();
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;
JLabel groupsLabel = new JLabel("Groups:", SwingConstants.LEFT);
comboGroups = new JComboBox();
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?
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center