I've not tried this out but it might work...
myCombo.setRenderer(new DefaultListCellRenderer(){
public Component getListCellRendererComponent(
JList l,Object o,int i,boolean s, boolean f){
Component c=super.getListCellRendererComponent(l,o,i,s,f);
if(c instanceof JLabel)
((JLabel)c).setHorizontalTextPosition(SwingConstan ts.RIGHT);
}
});
If it doesn't, try changing "DefaultListCellRenderer" to
"javax.swing.plaf.basic.BasicComboBoxRenderer" ? Or look at the docs
for these classes.
Hal Vaughan <ha*@thresholddigital.com> wrote in message news:<nlB0c.152794$jk2.594715@attbi_s53>...
I have a JComboBox with a list of numbers, from 1 digit to 5 digits.
Numbers with more than 3 digits have a comma in them.
I've been aligning them with leading spaces. Is there any simple and quick
way to align all the items in a JComboBox with the right edge of the box
(which, in this case, would mean all columns keep the same place value)?
Thanks!
Hal