Thanks in advanced,
Casper
If it is not mission critical that the string can be displayed, use the
setColumns method. It assumes that in the font being used, 'm' us the widest
character, and sizes the JTextField to be able to fit the string composed of
N 'm's appended together.
If it IS mission critical, you will need to get a hold of the Font
object, and render every character into an off-screen buffer, measure their
widths, and the use the maximal width as the width of a single column,
multiply it by how long you string is, set the width of the JTextArea to
that. There are approximately one million Unicode characters.
- Oliver