Reputation: 2566
I tried the following:
machineComboBox.setEmptySelectionAllowed(false);
machineComboBox.focus();
this.addComponent(machineComboBox);
I read:
Cannot set focus on combobox inside a grid
Upvotes: 1
Views: 309
Reputation: 2652
What exactly you are trying to achieve? If you simply want to select the first item, then this should work:
machineComboBox.setSelectedItem(yourItems.get(0));
Example is taken from here : Selection Components
focus()
doesn't select anything, only focuses (outlines) the component.
Upvotes: 2