Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 404
Registered: ‎05-31-2011
My Device: curve
My Carrier: devel
Accepted Solution

use two different font size in the same field

hi, how to use to different font in the same field?

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: use two different font size in the same field

unless you overwrite paint: you don't.
if you do, you can use graphics.setFont
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Contributor
Posts: 3
Registered: ‎02-09-2013
My Device: 9900
My Carrier: tata

Re: use two different font size in the same field

i have overriden the paint method..but i want to insert two text of different size in same customized field..m nt getting hw to do that.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: use two different font size in the same field

Quick sample:

 

.... paint(Graphics g) {

g.setFont(font1);

g.drawText(...);

g.setFont(font2);

g.drawText(...);

}

New Contributor
Posts: 3
Registered: ‎02-09-2013
My Device: 9900
My Carrier: tata

Re: use two different font size in the same field

i hv tried that. Then in that case the font size of text initially for few seconds remain as set by first statement.. Then automatically it gets converted into the font as set by statement two..

 

New Contributor
Posts: 3
Registered: ‎02-09-2013
My Device: 9900
My Carrier: tata

Re: use two different font size in the same field

Yupp..i got it..Your code works..Hv did minor mistake..