I have a JComboBox inside a JPanel (which itself is nested within a few other JPanels). It's populated with members of an enum. I'm running into a problem where the popup menu doesn't appear when I click the expand button.
Here's the information I've gathered so far:
1) The first click on the expand button does nothing. The second click highlights the contents of the box, but the popup still doesn't appear.
2) Once I've clicked the button and given it focus, up/down keystrokes cycle through the entries correctly.
3) I've tried adding a PopupMenuListener to print out events, and the events fire in unexplained ways:
mouse down: popupMenuWillBecomeVisible fires
mouse up: nothing
mouse down: popupMenuWillBecomeInvisible fires
mouse up: nothing
Here's my initialization code for the JComboBox:
comboBox = new JComboBox();
comboBox.setPreferredSize(new Dimension(175, 30));
comboBox.setMaximumSize(new Dimension(175, 30));
comboBox.setAlignmentX(0.5f);
comboBox.addItem(Enum.Value1);
...
parentPanel = new JPanel();
parentPanel.setLayout(new BoxLayout(parentPanel, BoxLayout.X_AXIS));
parentPanel.setMaximumSize(new Dimension(37267, 50));
... add some other stuff to parentPanel ...
parentPanel.add(comboBox);
Does anyone have any idea why the popup menu might not be appearing?
Thanks for the help!