can javax.swing.Box display content from right to left ?
I want to my swing program fully support globalization. If the locale is Hebrew or Arabic the content should displayed from right to left. Most of swing components have this ablity. But i found javax.swing.Box and some code like this:
contentPane.add(getLoginPanel(),BorderLayout.WEST);
contentPane.add(getBackgroundMosaic(),BorderLayout.EAST);
that all not support rtl orientation, is it ?
how to make these components supports Arabic locale ?
[475 byte] By [
madoua] at [2007-10-3 4:46:01]

I don't understand your question. A Box layout doesn't use constraints like BorderLayout.WEST or BorderLayout.EAST.
If you are not sure if something works, then try it. If it doesn't work then you have code to post on the forum so we can see if you are doing anything wrong or whether its just not supported.
In any case you need to use Component.setComponentOrientation(..) to get Left-to-Right layouts.
I think maybe you are talking about BoxLayout? You can specify components to be laid out on the PAGE_AXIS, which will be either ltr or rtl depending on the user's locale.Check the documentation: http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/BoxLayout.html
o, sorry, i think i was not descript the problem clearly.
That is the two seperate problem all about rtl .
first , i can not find way to make javax.swing.Box support rtl.
second, it is a panel in a JDialog. some components put into the panel by such code:
contentPane.add(getLoginPanel(),BorderLayout.WEST);
contentPane.add(getBackgroundMosaic(),BorderLayout.EAST);
i want to know whether this panel can support rtl.
madoua at 2007-7-14 22:50:22 >

the second problem resolved too.
For BorderLayout use BorderLayout.BEFORE_LINE_BEGINS and BorderLayout.AFTER_LINE_ENDS instead of EAST and WEST, which will make the layout sensitive to the ComponentOrientation setting.
http://www-306.ibm.com/software/globalization/expertise/faq_bidi.jsp
madoua at 2007-7-14 22:50:22 >
