I have a problem with my Jbuttons.
In my application, you can easily change the ui language and you can easily override the default translations for my buttons.
In this case, it is very unclear how long the text can be in a button, but my buttons have a fixed size (because of graphical harmony and so on).
Now my problem is, that I haven't found a solution to wrap a text with a inner button margin.
Example:
BUTTON 1: "Hello" -> Hello is short enough to be printed without newline.
BUTTON 2: "Hello guys" -> Due to the html tags, Hello guys will be automatically wrapped in two lines.
BUTTON 3: "Hello g." -> Hello g. fills exactly the width of the button. No word wrap by HTML!.
Now, the button 3 itself looks very crappy and overloaded.
Therefore I need a solution to automatically wrap a text which is wider or equal -4px than the button.
Additionally a text which doesn't contain a whitespace, should be wrapped either if it is too long.