views:

177

answers:

1

I have a JInternalFrame in a JDesktop, and I also have a JComboBox in the internal frame. The problem is shown below.

problem

How can I make JComboBox paint outside JInternalFrame, so that the popup list can be shown completely? Is using glass pane an optimal solution, or would it be bad practice?


SOLUTION: I have found the solution; just override the getSize() method of JComboBox:

class MyComboBox extends JComboBox{

    public Dimension getSize(){
        return new Dimension(..);
    } 
}
+1  A: 

I'd try calling setLightWeightPopupEnabled(false) on the JCombobox before attempting anything with the glass pane.

Nate
Unfortunately, it didn't work.. I am using it as follows: class MyComboBox extends JComboBox{ public MyComboBox(){ setLightWeightPopupEnabled(false); } }
Erkan Haspulat