Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2009

Tip: Looking for answers? Try searching our database.

Question about RTL, jComboBox and setComponentOrientation

Thread view: 
mttc - 02 Jul 2009 16:04 GMT
I try:
jComboBox1.setComponentOrientation
(ComponentOrientation.RIGHT_TO_LEFT);

the Drop down button is indeed place on left side, but the list still
alignment to the Left!

More two q:
+what is setAligmentX ?
+have a way to use with Horizontal Resizeable on Right to left form,
in order that size grow from Right to left when the form is resize?
John B. Matthews - 02 Jul 2009 19:23 GMT
In article
<75445bfe-c43a-4b26-b962-ac5693a66ff4@i6g2000yqj.googlegroups.com>,

> I try:
> jComboBox1.setComponentOrientation
> (ComponentOrientation.RIGHT_TO_LEFT);
>
> the Drop down button is indeed place on left side, but the list still
> alignment to the Left!

I get right-to-left text; but I also see left alignment, despite using
the correct Locale. JButtons look OK, though:

<http://i41.tinypic.com/209myl1.png>

[All strings start with \u05d0; the rest is, I hope, random.]

> More two q:
> +what is setAligmentX ?
> +have a way to use with Horizontal Resizeable on Right to left form,
> in order that size grow from Right to left when the form is resize?

A JComponent's setAligmentX() and setAligmentY() methods may be used by
a layout manager, e.g. BoxLayout:

<http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html>

There may be other uses.

Signature

John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

mttc - 02 Jul 2009 19:49 GMT
> I get right-to-left text; but I also see left alignment, despite using
> the correct Locale. JButtons look OK, though:

Now I see that this problem reported by Kirill Grouchnikov's Blog At
2006, and nothing happen since.

John B. Matthews did you know something about the RTL support?
I also try to get answer about JavaFX, I not see any RTL Support, and
I ask that here with no answer.

it'seem that Java is not preferred platform for RTL lang. this is
correct?
John B. Matthews - 02 Jul 2009 22:00 GMT
In article
<68cf1c48-36c5-4eb9-ab6b-20555b10562f@t21g2000yqi.googlegroups.com>,

> > I get right-to-left text; but I also see left alignment, despite using
> > the correct Locale. JButtons look OK, though:
>
> Now I see that this problem reported by Kirill Grouchnikov's Blog At
> 2006, and nothing happen since.

For reference:

<http://weblogs.java.net/blog/kirillcool/archive/2006/03/rtl_support_in_1.html>

> John B. Matthews, did you know something about the RTL support? I also
> try to get answer about JavaFX, I not see any RTL Support, and I ask
> that here with no answer.

No, this is my first foray. I've posted code if anyone wants to try it
on their platform:

<http://sites.google.com/site/trashgod/rtlcombotest>

> it'seem that Java is not preferred platform for RTL lang. this is
> correct?

Well, on my implementation, it's displayed legibly, although I'd have
expected the margin to be flush right.

Can you post a picture of what you're seeing?

Signature

John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

mttc - 02 Jul 2009 23:15 GMT
>> Can you post a picture of what you're seeing?

No need, it's like you got and like Kirill Grouchnikov's Blog.

See also http://weblogs.java.net/blog/kirillcool/archive/2006/02/aligning_menu_i_1.html

Again, it's seem that Java not for RTL lang. Try to find article about
JavaFX and RTL..
John B. Matthews - 03 Jul 2009 01:17 GMT
In article
<86c6b403-baf6-47e8-b17d-0bdb8e6405f0@32g2000yqj.googlegroups.com>,

> >> Can you post a picture of what you're seeing?
>
[quoted text clipped - 4 lines]
>
> Again, it's seem that Java not for RTL lang.

I disagree. I think the appearance is acceptable. It's easy enough to
right justify the entries with a custom renderer having right
horizontal alignment:

<http://sites.google.com/site/trashgod/rtlcombotest>
<http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html>

Custom selection highlighting is optional.

Signature

John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

mttc - 03 Jul 2009 10:17 GMT
> In article
> <86c6b403-baf6-47e8-b17d-0bdb8e640...@32g2000yqj.googlegroups.com>,
[quoted text clipped - 21 lines]
> trashgod at gmail dot com
> <http://sites.google.com/site/drjohnbmatthews>

I'm very glad to see this option. I hope that have a way to extend new
Class that include this Renderer.
Me problem is, I see the Java is better for me then .NET, but it's
have a lack discussion about RTL, and I not find

Another Issues of Java on local. I realize that Swing Drew the Font
internally, not by Win API. this cause some program to not work on
JTextArea. like a Babylon (pop up translate tools:http://
www.babylon.com/)

Until now a way to interact with Java dev team. So I try ask in this
form. but I think that most MiddelEast users prefer Microsoft, so it
have very few talking about RTL.

For example until now, no body answer about JavaFX RTL support.

thanks a lot
Christian Kaufhold - 03 Jul 2009 15:52 GMT
> I try:
> jComboBox1.setComponentOrientation
> (ComponentOrientation.RIGHT_TO_LEFT);
>
> the Drop down button is indeed place on left side, but the list still
> alignment to the Left!

The default combo box renderer misses picking up the ComponentOrientation
from its context.

This is bad, but for anything nontrivial one would use a custom renderer
anyway.

Fix:

class GoodComboBoxRenderer
   extends javax.swing.plaf.basic.BasicComboBoxRenderer
{
   public Component getListCellRendererComponent
       (JList l, Object value, int index, boolean selected, boolean focused)
   {
       super.getListCellRendererComponent(l, value, index, selected, focused);

       setComponentOrientation(l.getComponentOrientation());

       return this;
   }
}


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.