[izpack-devel] UserInputPanel - replacing MultiLineLabelwithJTextPane?

Vladimir Ralev vralev at redhat.com
Sat Nov 18 19:07:23 CET 2006

 From my experience the problem can't be resolved with setFont() at all. 
Once you set the content type to "text/html" the font is managed only by 
the HTML engine and I couldn't find a way to manipulate it's default 
font. This is why I only enable HTML rendering when the text is 
surrounded in <html> tags. If your string doesn't have <html></html>, it 
will render like the MultiLineLabel, except the text will be selectable.

 From the screenshot - number 1 is declared as follows:
      <field type="staticText" align="left"
         txt="<html>This section allows you to control whether the JMX 
interfaces are secured. See <a 
for additional security configuration.</html>"

number 2 is declared as:
      <field type="text" variable="jmxConsoleDomain">
         <description align="left" txt="The JAAS security domain name 
for the jmx access points"
         <spec txt="Enter security-domain:" id="text.label" size="32" 

(Notice that 1 has the <html> tags and thus used the HTML default font, 
while 2 has the label's default font.)

Attached also is the patch.

The links do not launch the pages for now. This is left as a TODO.

Bartz, Klaus wrote:
> Hi,
> but please no removing of the class MultiLineLabel because I use
> it in some custom panels.
> In PacksPanelBase.createTextArea the font problem will be managed.
> Simple area.setFont(getControlTextFont());
> As I know current minimal VM version is 1.4.
> Cheers
> Klaus
>> -----Original Message-----
>> From: izpack-devel-bounces at lists.berlios.de
>> [mailto:izpack-devel-bounces at lists.berlios.de]On Behalf Of Elmar Grom
>> Sent: Wednesday, November 15, 2006 5:41 PM
>> To: izpack-devel at lists.berlios.de
>> Subject: Re: [izpack-devel] UserInputPanel - replacing
>> MultiLineLabelwithJTextPane?
>> This sounds like a good idea. However, I don't think we have 
>> to be content
>> with the font. It should be possible to get the label font and 
>> then set that
>> as font on the JTextPane.
>> One issue might be version compatibility. At least for a while 
>> there was a
>> desire to have IzPack compatible as far back as possible. I 
>> don't know if we
>> have a policy at present and if so, what the desired version 
>> compatibility
>> is.
>> 	Elmar
>> -----Original Message-----
>> From: izpack-devel-bounces at lists.berlios.de
>> [mailto:izpack-devel-bounces at lists.berlios.de]On Behalf Of Vladimir
>> Ralev
>> Sent: Saturday, November 11, 2006 4:07 AM
>> To: izpack-devel at lists.berlios.de
>> Subject: [izpack-devel] UserInputPanel - replacing MultiLineLabel
>> withJTextPane?
>> At least for staticText field types it's useful to have the html
>> formatting enabled. It also allows the text to be 
>> selected/copied/pasted
>> (links, numbers...). With some tweaks it can start the links with the
>> default Internet browser. I tested it on Windows with jdk5, 
>> the only con
>> being that if html content is used the default html font is different
>> than the default label font, but it's not that bad (screen shot
>> attached) and can be fixed either by not using "text/html" content or
>> making html formatting to match the font.
>> What do you think?
>> --
>> Vladimir Ralev, JBoss/RedHat
>> _______________________________________________
>> izpack-devel mailing list
>> izpack-devel at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/izpack-devel
> _______________________________________________
> izpack-devel mailing list
> izpack-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/izpack-devel

Vladimir Ralev, JBoss/RedHat

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: staticTextWithJTextPane.patch
Url: https://lists.berlios.de/pipermail/izpack-devel/attachments/20061118/b62aaca7/attachment.ksh 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jmxpanel-fonts.JPG
Type: image/jpeg
Size: 49330 bytes
Desc: not available
Url : https://lists.berlios.de/pipermail/izpack-devel/attachments/20061118/b62aaca7/attachment.jpe 

More information about the izpack-devel mailing list