This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 82510 - Matisse doesn't calculate the size of HTML formatted JLabels properly
Summary: Matisse doesn't calculate the size of HTML formatted JLabels properly
Status: RESOLVED DUPLICATE of bug 79967
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Natural Layout (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-11 16:47 UTC by alanbur
Modified: 2006-08-14 10:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alanbur 2006-08-11 16:47:53 UTC
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.
Comment 1 Tomas Pavek 2006-08-14 09:18:47 UTC
Sorry, but we don't seem to be able to do anything about this. It is the 
JLabel's behavior in html rendering mode - it does not provide correct 
preferred size (height) until first painted with the desired width. We could 
workaround this behavior in the preview but you would still see it when 
executing the UI. See aslo issue 79967.

*** This issue has been marked as a duplicate of 79967 ***
Comment 2 alanbur 2006-08-14 10:07:04 UTC
This looks to me like the real bug is in JLabel.  Do you know if a bug has been
raised against JLabel for this?