File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Internationalization and Font size

 
Pres Brawner
Ranch Hand
Posts: 92
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Imagine this. You've got a string of text that needs to be internationalized. You keep the size of the text box in a properties file so it can be modified depending on the language used.
However, you use System.properties to get the font size from the device using your software. If they have font size bigger than your recommended, your text string gets truncated (unless they manually resize).
I have a couple of ideas. What are yours?
Thanks,
Pres
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can either change the font size so the text will fit, or change the size of the TextField to fit the font.
 
Pres Brawner
Ranch Hand
Posts: 92
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm.
The font size can't be changed. It's user dependant. The problem is the size of the box. The question is, how would YOU go about changing the box size.
Does that help clarify the problem?
Thanks,
Pres
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would read this post to learn how to determine the size of the text at run time. Then I would use the setMinimumSize() and setPreferredSize() methods in Component to ensure that my component would be big enough. Exact details will depend on what sort of component you use, what layout manager, etc. One thing that's worth trying - if your outer container is a Window or JInternalFrame, the pack() method usually does a decent job of finding the best size for a component. Good luck.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic