I have a simple panel with a comboBox, but I'm having a problem with the comboBox, taking up too much space, I can't seem to resize it.
I have the code:
frame.setLayout(new GridLayout(10, 1));
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
panel.add(new JLabel("Type: "));
JComboBox comboBox1 = new JComboBox(labels);
panel.add(comboBox1);
frame.add(panel);
frame.setSize(550,300);
frame.setVisible(true);
Where labels is an array of strings, this is how my comboBox looks after running:
If I try to change the size of the comboBox using setSize(), it doesn't seem to do anything? As I still get the same sized comboBox. Any ideas?