Skip to main content



      Home
Home » Archived » Visual Editor (VE) » jLabel.setFont(font);
jLabel.setFont(font); [message #89193] Mon, 02 May 2005 10:48 Go to next message
Eclipse UserFriend
Hello,


is there a possibility to set font, that is a variable. For example:




private Font font = new Font("Dialog", Font.PLAIN, 12);

jLabel.setFont(font);




If I do it so I get an exception: java.lang.IllegalArgumentException.... I
tried it also with VE_1.1.


If I have a class derived from JLabel and set the font within the class I
do not get any exception.


Is this different behavior ok?



Thanks
Elena
Re: jLabel.setFont(font); [message #89222 is a reply to message #89193] Mon, 02 May 2005 12:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

For now you need to tell VE that font is something of interest. Try
using this:

private Font font = new Font("Dialog", Font.PLAIN, 12); //
@jve:decl-index=0:visual-constraint=""


(Note: It must be one line, if it looks wrapped above it is due to the
line being wrapped).

This should work.
--
Thanks,
Rich Kulp
Re: jLabel.setFont(font); [message #89296 is a reply to message #89222] Tue, 03 May 2005 02:59 Go to previous messageGo to next message
Eclipse UserFriend
Hello,


I tried it with the line you recommended but it didn't work. Although the
definition of the label and the annotation were in the same line.



If the variable font is a local variable then no exception will be caused.
Only if the variable is global then an exception will be caused.




Thanks
Elena
Re: jLabel.setFont(font); [message #89418 is a reply to message #89296] Tue, 03 May 2005 10:27 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

This is a bug. I just opened:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=93533

on it.


--
Thanks,
Rich Kulp
Re: jLabel.setFont(font); [message #607293 is a reply to message #89193] Mon, 02 May 2005 12:19 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

For now you need to tell VE that font is something of interest. Try
using this:

private Font font = new Font("Dialog", Font.PLAIN, 12); //
@jve:decl-index=0:visual-constraint=""


(Note: It must be one line, if it looks wrapped above it is due to the
line being wrapped).

This should work.
--
Thanks,
Rich Kulp
Re: jLabel.setFont(font); [message #607308 is a reply to message #89222] Tue, 03 May 2005 02:59 Go to previous message
Eclipse UserFriend
Hello,


I tried it with the line you recommended but it didn't work. Although the
definition of the label and the annotation were in the same line.



If the variable font is a local variable then no exception will be caused.
Only if the variable is global then an exception will be caused.




Thanks
Elena
Re: jLabel.setFont(font); [message #607317 is a reply to message #89296] Tue, 03 May 2005 10:27 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

This is a bug. I just opened:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=93533

on it.


--
Thanks,
Rich Kulp
Previous Topic:Select bean, component is red-marked in "Java Beans" pane.
Next Topic:toolbar problem
Goto Forum:
  


Current Time: Mon Jun 23 00:23:33 EDT 2025

Powered by FUDForum. Page generated in 0.04301 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top