Changing fonts in a JLabel

Is there a recommended way to modify the font attributes of a JLabel via the xml .form file? It doesn't look like there is any way to do this via the uiDesigner yet, and the Font object doesn't have any setters so when I've tried to use the ]]> to set things up, no avail.

I've resorted to binding the jlabels to the bound class, and setting the font attribute that way, but if there is a better way.. i'm all for being informed.

6 comments

Andrew Lombardi wrote:

Is there a recommended way to modify the font attributes of a JLabel via the xml .form file? It doesn't look like there is any way to do this via the uiDesigner yet, and the Font object doesn't have any setters so when I've tried to use the <property></property> to set things up, no avail.

I've resorted to binding the jlabels to the bound class, and setting the font attribute that way, but if there is a better way.. i'm all for being informed.


bind label to fild and use JLabel.setFont() method

With best regards,
Vladimir Kondratyev
_____________________
JetBrains

0

Vladimir,

thanks for your response, as I noted at the bottom of my post, thats exactly what I have resorted to.

My question was really more of if this is possible via XML at the moment, and if not now, if it is a planned feature in the future?

Thanks in advance.

0

Andrew Lombardi wrote:

Vladimir,

thanks for your response, as I noted at the bottom of my post, thats exactly what I have resorted to.

My question was really more of if this is possible via XML at the moment, and if not now, if it is a planned feature in the future?

Thanks in advance.


Currently it's not possible via XML. Concerning future: we will allow
editing of fonts in UI designer.

With best regards,
Vladimir Kondratyev
_____________________
JetBrains

0

On Tue, 11 Nov 2003 13:01:07 +0300, Vladimir Kondratyev (JetBrains) wrote:

Currently it's not possible via XML. Concerning future: we will allow
editing of fonts in UI designer.


Hopefully font styles/sets - so you don't keep redefing each font
attribute all over the place, leading to that one magic button somewhere
using a 10pt font rather than 12pt :p

0

Mark Derricutt wrote:

On Tue, 11 Nov 2003 13:01:07 +0300, Vladimir Kondratyev (JetBrains) wrote:

>>Currently it's not possible via XML. Concerning future: we will allow
>>editing of fonts in UI designer.


Hopefully font styles/sets - so you don't keep redefing each font
attribute all over the place, leading to that one magic button somewhere
using a 10pt font rather than 12pt :p


There is already a kind of "style sheet" LookAndFeel. If you need a
style then change LookAndFeel. That is "magic" button.

With best regards,
Vladimir Kondratyev
_____________________
JetBrains

0

On Mon, 17 Nov 2003 15:36:38 +0300, Vladimir Kondratyev (JetBrains) wrote:

>> Hopefully font styles/sets - so you don't keep redefing each font
>> attribute all over the place, leading to that one magic button somewhere
>> using a 10pt font rather than 12pt :p


There is already a kind of "style sheet" LookAndFeel. If you need a style
then change LookAndFeel. That is "magic" button.


Maybe I'm showing my lack of Swing understanding here, but I didn't think
L&F was that find grained.

I was more thinking along the lines of say "Text Editor Style" which you
apply to all text entry dialogs where you may enter a script, this would
have a standard font size/face, but would be different to those text area
controls set as a different style.

0

Please sign in to leave a comment.