Tree view bean: setFont

Trying to set the font to our tree views programmatically and coming up blank. Tried both:

elements.bean_tree.setFont(‘Verdana’,‘0’,‘10’)
elements.bean_tree.setFont(new java.awt.Font(‘Verdana’,‘0’,‘10’))

Setting the font of the bean in design mode is the only thing I’ve been able to get working so far. Bug or am I doing something wrong?

Looking at the sources, the setFont() method is accepting one String, so I would try:
elements.bean_tree.setFont(‘Verdana,0,10’);

There is also an overriden method with a Font, so:
elements.bean_tree.setFont(new Packages.java.awt.Font(‘Verdana’,0,10)); // the first param is a String, the 2 others are int.

No love. Also tried:

elements.bean_tree.setFont(‘Verdana 0 10’)

david:
No love. Also tried:

elements.bean_tree.setFont(‘Verdana 0 10’)

No, the String it is tokenized on “,” not on spaces.

Yea, tried commas first.

The way to do it is definitely:
elements.bean_tree.setFont(‘Verdana,0,10’);
or
elements.bean_tree.setFont(new Packages.java.awt.Font(‘Verdana’,0,10));

The 2 method implementations are straight-forward, so if none of these work, I would call it a bug, probably creeping elsewhere…
Have you tried updating the bean after setting the font?

Bean refresh and UI update not kicking it into gear either. Ah well :(

Thanks for looking at the backend Patrick.

Actually, it looks like the function is actually doing something. Specifically, putting the font settings of the bean back to default (either by overwriting or by removing entirely).

IE, If you set the font of the bean in design time and then do a beanxxx.setFont(…) at run time, the run time call wipes out the design time setting.

Wow. That’s something else. You should open a case on this.

issue is fixed in the next release