Adjust buttons, labels, ... / internationalization

Hi,

I have a tabbedPane, and some of my labels in this pane have - depending on the language - very different sizes.
I use borderLayout and GridLayout-Manager. But when the text of a label is longer than the usual size of the label, it is cutted off instead of the layout-manager adjusts the size of the label.

How does this work correct?
spetrowitschAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

spetrowitschAuthor Commented:
Adjusted points to 25
0
BillyAbbottCommented:
is the length of the label changing at runtime? if something has already been laid out, and then you change something, you have to tell the container to relayout the objects it contains.

look ath the invalidate methods on the containter class, i thihk.
0
hilitCommented:
Have you used setMinimumSize, SetPreferredSize, setSize etc?
0
spetrowitschAuthor Commented:
The length of the labels depends on the value in the internationalization-file (ResourceBundle). this.invalidate() doesn´t adjust the size of the labels, when I call this function at the end of my jbInit-function.

No, I didn´t set the setMinimumSize, SetPreferredSize, etc. for the label, which I am adjusting in size.
0
BillyAbbottCommented:
what do you mean by the 'usual length' of the labels?

if you are setting the label text truly language independantly, then there shouldn;t be a usual length...

have a check on the code that initialises the labels, and make sure that there isn;t any legacy code knockign around.

as for invalidate, i havegot it to work properly, but only by hacking around with it. i just looked at the api spec, and i think that if you are dynamically changing the label lengths at runtime, then you would have to invoke invalidate() on the labels that need to be changed, change their properties, and then call validate() on the container (the tabbedPane?)

also, i've just noticed that you sadi you were using the gridlayoutmanager, which divides up the the area to be laid out into EVENLY SIZED BOXES, and then resizes the ocmponents to this size, totally ignoring the preferred sizes of the ocmponents. i think that is the problem, and would reccommend not using it if possible.

sorry about the mishsmash of ideas, but it's one of those days.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.