• Post Reply Bookmark Topic Watch Topic
  • New Topic

Localization Of Desktop Icons For An Application  RSS feed

 
Ikram Shahzad
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

I am trying make a desktop in java. i want to localize it for different language. For english it should start from left most to right and for arabic right most to left.not in the center of screen. can any body have some suggestion about it.



[ August 04, 2008: Message edited by: Ikram Shahzad ]
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch

Please use the code button (below the message window) when quoting code; it makes it easier to read.

Is the Internationalisation part of the Java Tutorials of nay use to you?
 
Ikram Shahzad
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i donot thing so. i just want to change the layout of the icons.



when i change the locale of the component it successfully change the text orientation but i want to change the layout of the panel to..
[ August 04, 2008: Message edited by: Ikram Shahzad ]
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ikram Shahzad:

this.iconPanel.setComponentOrientation(java.awt.ComponentOrientation.getOrientation(currentLocal));


Tried your code. After uncommenting the above line, the layout changes. What is the problem? Did you perhaps forget to uncomment the line?
 
Ikram Shahzad
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the icons are coming in the center of the screen i want it to be on the right side of the screen after the layout change.
[ August 04, 2008: Message edited by: Ikram Shahzad ]
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ikram Shahzad:
the icons are coming in the center of the screen i want it to be on the right side of the screen after the layout change.

[ August 04, 2008: Message edited by: Ikram Shahzad ]


That has nothing to do with ComponentOrientation. Orientation means exactly what it says; orientation.

The location/placement is controlled by the layout manager. In your case, you havent defined the weightx and weighty which is causing the components to cluster in the middle.
Use the following to get the desired placement.
 
Ikram Shahzad
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this one out.


 
Ikram Shahzad
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have make the chages about weighx and weighty but the panel is comming on left-top it should be right-top
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ikram Shahzad:
i have make the chages about weighx and weighty but the panel is comming on left-top it should be right-top

Did you set this too?
 
Ikram Shahzad
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes i have tried i but now result. the panel orientation is still left to right. do we need to change the panel orientation 2.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ikram Shahzad:
yes i have tried i but now result. the panel orientation is still left to right. do we need to change the panel orientation 2.


Strange. Works for me.
Is your setOrientation line commented out by any chance?
If yes, can you post your code?
 
Ikram Shahzad
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i have remove the committed line.here is the updated code



[ August 04, 2008: Message edited by: Ikram Shahzad ]
[ August 04, 2008: Message edited by: Ikram Shahzad ]
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The buttons are correctly oriented as per the locale inside the icon panel. To confirm this uncomment the first line and comment out the second.
 
Ikram Shahzad
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thnx bro i got it... the problem was ... that i was not setting the weightx and weighty for cell and also the jpanel width was not properly set.

agaib thnx alot fo help...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!