Skip to main content

Font

2 replies [Last post]
heziflash
Offline
Joined: 2008-06-03
Points: 0

Hi
If i use the "simple" label :
Label comunity = new Label("Join Community?:");
then, after declaring the RadioButton, i can choose between "Yes" and "No".
but if i use:
Label fontLabel = createFont(Font.getBitmapFont("Serf"), "Join Community");
first, my cursor is standing on "Join Community" and only after that, clicking on the "arrow", the cursor is jumpping to "Yes".
why?

Form get_form_Reg_Fangstorm(){

if (RegFangForm == null)
{
RegFangForm = new Form ("Fangstrom");
RegFangForm.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
try {
Label fontLabel = createFont(Font.getBitmapFont("Serf"), "Join Community");
RegFangForm.addComponent(fontLabel);

} catch (IOException ex) {
ex.printStackTrace();
}
// Label comunity = new Label("Join Community?:");

RadioButton rb1 = new RadioButton("Yes");
RadioButton rb2 = new RadioButton("No");
}

private Label createFont(Font f, String label) {
Label fontLabel = new Label(label);
fontLabel.getStyle().setFont(f);
fontLabel.setFocusable(true);
fontLabel.getStyle().setBgTransparency(0);
return fontLabel;
}

Thanks,
Hezi

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
heziflash
Offline
Joined: 2008-06-03
Points: 0

Thanks Chen

chen

Hi Hezi,
You declared the Label

fontLabel.setFocusable(true);

This is why it grabs the Focus.

Regards,
Chen

lwuit-users@mobileandembedded.org wrote:
> Hi
> If i use the "simple" label :
> Label comunity = new Label("Join Community?:");
> then, after declaring the RadioButton, i can choose between "Yes" and "No".
> but if i use:
> Label fontLabel = createFont(Font.getBitmapFont("Serf"), "Join Community");
> first, my cursor is standing on "Join Community" and only after that, clicking on the "arrow", the cursor is jumpping to "Yes".
> why?
>
>
> Form get_form_Reg_Fangstorm(){
>
> if (RegFangForm == null)
> {
> RegFangForm = new Form ("Fangstrom");
> RegFangForm.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
> try {
> Label fontLabel = createFont(Font.getBitmapFont("Serf"), "Join Community");
> RegFangForm.addComponent(fontLabel);
>
> } catch (IOException ex) {
> ex.printStackTrace();
> }
> // Label comunity = new Label("Join Community?:");
>
> RadioButton rb1 = new RadioButton("Yes");
> RadioButton rb2 = new RadioButton("No");
> }
>
> private Label createFont(Font f, String label) {
> Label fontLabel = new Label(label);
> fontLabel.getStyle().setFont(f);
> fontLabel.setFocusable(true);
> fontLabel.getStyle().setBgTransparency(0);
> return fontLabel;
> }
>
> Thanks,
> Hezi
> [Message sent by forum member 'heziflash' (heziflash)]
>
> http://forums.java.net/jive/thread.jspa?messageID=286996
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net