Hello,
for some times ago i applied a code snippet to remove the cancel button from a CheckBoxListComboBox instance:
viewtopic.php?f=18&t=16394&p=80685&hilit=cancel+button&sid=70eaef581a5b6faef918b4201932a781#p80685
It worked good. The only problem it appears, if i try to set the width of the popuppanel, sometimes the popuppanel is right aligned, and somtimes left aligned.
I use this code, to set the size:
public class MyClass extends CheckBoxListComboBox {
@Override public void popupMenuWillBecomeVisible(PopupMenuEvent pme) {
isvisible = true;
//set the size of the popuppanel
if(this._popupPanel.getPreferredSize().width < 150) {
this._popupPanel.setPreferredSize( new Dimension(150, this._popupPanel.getSize().height) );
}
}
}
Left/Right aligned: the position of the popuppanel relative to the dropdown menu.
It seems, the popuppanel get's left aligned if there is a long text.
The right aligned popup contains only short texts.
Can you help to turn the right alignment into a left alignment?
Thank you,
Daniel