开发者

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.

JCombobox's popup list is not painted completely

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(){
        re开发者_StackOverflowturn new Dimension(..);
    } 
}


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜