JCombobox dropdown list issue?

I have a root panel (2 rows, 1 column) in which there is a P panel and an L label in it. P has a JComboBox B in it. Whenever I click on B, a popup menu appears behind L. How can I fix this? I played with all kinds of setComponentZOrder (), but I could not fix it. What should I do?

+5
source share
2 answers

Do not mix heavy components (e.g. label) with light components (e.g. JLabel).

If you use Swing, always use lightweight components starting with J.

+4
source

use combobox.setOpaque(true)

I found it here .

+1

All Articles