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?
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.
use combobox.setOpaque(true)
combobox.setOpaque(true)
I found it here .