Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JCombobox dropdown visibility issue?

I have a root panel (2 rows, 1 column) which has panel P and a label L in it. P has a JComboBox B in it. Whenever I click on B, the resulting dropdown shows-up behind L. How do I fix this? I played around with all sorts of setComponentZOrder() but I could not fix this. What should I do?

like image 866
pathikrit Avatar asked Jul 19 '11 18:07

pathikrit


1 Answers

Don't mix heavyweight components (e.g. Label) with lightweight components (e.g. JLabel).

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

like image 142
Marcel Avatar answered Sep 28 '22 04:09

Marcel