Erkan Haspulat
Erkan Haspulat

Reputation: 12552

JCombobox's popup list is not painted completely

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(..);
    } 
}

Upvotes: 0

Views: 1037

Answers (1)

Nate
Nate

Reputation: 16898

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

Upvotes: 1

Related Questions