UPDATE 20/1/2011: I have updated the source code to allow you to set the text colour and background colour of the returned panels. I have also added a .jar and read me so you can simply import the .jar into your project and start using the code, see multilinelabel_update.zip
---
GUI's in Java can baffle people particularly when dealing with awt after having already learnt Swing. One thing that many people struggle with when dealing with awt is the lack of those extra features that Swing has added. In my case as a programming designer I wanted to display information in a label but I wanted to have it in a multiline format. Awt has no inbuilt multi-line label capacity, so I wrote a class that would allow me to split a given string string at a given maximum character width without splitting any words.
---
GUI's in Java can baffle people particularly when dealing with awt after having already learnt Swing. One thing that many people struggle with when dealing with awt is the lack of those extra features that Swing has added. In my case as a programming designer I wanted to display information in a label but I wanted to have it in a multiline format. Awt has no inbuilt multi-line label capacity, so I wrote a class that would allow me to split a given string string at a given maximum character width without splitting any words.
2 Comments
