how to set hint text size and font in j2me using lwuit

349 views Asked by At

i am applying bitmap font to textfield and its working fine but textfield hint text size is not set as per i have applied font created using resource editor.please help me here how to set text filed hint text size? i am using this code

emailtext.setHint("Email Address");

 Style styleTextfield=new Style();
 styleTextfield.setFont(font_textfield);
   styleTextfield.setFgColor(0x808080);

   emailtext.setSelectedStyle(styleTextfield);
   emailtext.setUnselectedStyle(styleTextfield);
   emailtext.setPressedStyle(styleTextfield);
2

There are 2 answers

6
Mun0n On

If you are using some .res file to customize your UI, the UIID to change the TextField's Hint text value is TextHint. Modify the font there, using the Resource editor, and you will change the TextField's hint style.

enter image description here

0
Ajibola On

What you want is to set the font of the unselected style of the TextField to be separate from the selected and pressed style :

 txtField.getUnselectedStyle().setFont(myHintFont);