This discussion is archived
0 Replies Latest reply: Jul 2, 2008 2:15 AM by 843851 RSS

How to change the focus' style

843851 Newbie
Currently Being Moderated
Hi everybody,

I have some problem with my xlet since i have two buttons and and I have added a focus to them but I don't know how to change the focus' style. When the focus is selected i get a white rectangle instead of it i wish to color the text with a yellow color. Can anyone give me a help how i can do this? Thanx in advance.
...
    
        button0 = new HTextButton("buttonA", 45, 182, 160, 46, new Font("Tiresias", Font.BOLD, 26), Color.white, Color.red, new HDefaultTextLayoutManager());
        button1 = new HTextButton("buttonB", 45, 292, 160, 46, new Font("Tiresias", Font.BOLD, 26), Color.white, Color.red, new HDefaultTextLayoutManager());
       
        button0.setHorizontalAlignment(HVisible.HALIGN_LEFT);
        button1.setHorizontalAlignment(HVisible.HALIGN_LEFT);
          
        button0.setFocusTraversal(button1, button1, button1, button1);
        button1.setFocusTraversal(button0, button0, button0, button0);
        scene.add(button0);
        scene.add(button1);

        button0.requestFocus();
...