[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

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?
0
spetrowitsch
Asked:
spetrowitsch
  • 2
  • 2
1 Solution
 
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now