Alan Burlison's Work Related Ramblings

All | General | Java | NetBeans | Perl | Solaris
« Run-time type checki... | Main | It's official: Sun... »

20060811 Friday August 11, 2006

HTML-formatted JLabels and Matisse

I was trying to lay out a dialog that used the Matisse layout manager and included some JLabels that used HTML tags to format the content. Although it looked fine in the NetBeans GUI designer, previewing the dialog showed that the content at the bottom of the dialog had disappeared because the dialog wasn't being made large enough. After a lot of fiddling around, it turns out that this is because Matisse can't determine the size of the JLabel properly if the text in it wraps over more than one line. The workaround is simple - insert <br> tags at the points at which the text wraps onto a new line, then the size of the JLabels can be determined correctly.

Posted by alanbur ( Aug 11 2006, 03:20:01 PM BST ) Permalink Comments [2]

Trackback URL: http://blogs.sun.com/alanbur/entry/html_formatted_jlabels_and_matisse
Comments:

Have you filed a bug @netbeans.org?

Posted by vince kraemer on February 01, 2007 at 11:08 PM GMT #

I'm not 100% sure it *is* a bug, but I've raised one anyway: #82510

Posted by 192.18.1.4 on February 01, 2007 at 11:08 PM GMT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed