Java/Swing - What to do when JComboBox is hidden behind a component or canvas?

This issue happens from time to time, where JComboBox is hidden behind a component or canvas. This is how you can very quickly fix the issue: Let's say this is...

This issue happens from time to time, where JComboBox is hidden behind a component or canvas. This is how you can very quickly fix the issue:

Let's say this is your code:

combobox = new JComboBox();
combobox.setFont(new Font("Tahoma", Font.PLAIN, 10));
panel.add(combobox);

Just add two more lines before adding the combobox to a panel:

combobox.setVisible(true);
combobox.setLightWeightPopupEnabled(false);

The whole thing should look like this:

combobox = new JComboBox();
combobox.setFont(new Font("Tahoma", Font.PLAIN, 10));
combobox.setVisible(true);
combobox.setLightWeightPopupEnabled(false);
panel.add(combobox);