problem with jcombobox

hi friends,

in a frame i put a jcombobox and i want that data it it becomes from the right to the left.

i tried the famous SetComponentOrientation() but really it didn't give me the solution because only the combobox changes direction howerer the data in the combo still from the left to the right.

i wish that you help me

[348 byte] By [mahrez85a] at [2007-11-27 6:36:48]
# 1
You can start at http://weblogs.java.net/blog/kirillcool/archive/2006/03/rtl_support_in_1.html
kirillga at 2007-7-12 18:04:54 > top of Java-index,Desktop,Core GUI APIs...
# 2
thanks kirillg,i have a poor english but if i understand well, this is not solved probleme.is it.
mahrez85a at 2007-7-12 18:04:54 > top of Java-index,Desktop,Core GUI APIs...
# 3

if the comboBox is editable, get the editor component (the textfield), then

textField.setHorizontalAlignment(JTextField.RIGHT);

this will have the effect of (if typing 1 2 3)

[ 123]

not

[ 321]

if uneditable, set your own renderer, casting the renderer component to a JLabel, then

label.setHorizontalAlignment(JLabel.RIGHT);

Michael_Dunna at 2007-7-12 18:04:54 > top of Java-index,Desktop,Core GUI APIs...
# 4
hi michael,really i am using jdevloper and i am not inserting in comboboxes manually.comboboxes have insertion from database automatically.thanks
mahrez85a at 2007-7-12 18:04:54 > top of Java-index,Desktop,Core GUI APIs...
# 5

hi,

i find the solution.

jComboBox1.setRenderer(new DefaultListCellRenderer() {

/** {@ineheritDoc}

*/

@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {

super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);

setHorizontalAlignment(RIGHT); //voir commentaires plus bas.

return this;

}

});

mahrez85a at 2007-7-12 18:04:54 > top of Java-index,Desktop,Core GUI APIs...