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.
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.
精彩评论