-
Bug
-
Resolution: Fixed
-
P3
-
8u20
-
Windows 7 Pro x64, JDK 1.8.0_20-ea-b11, JDK 1.8.0_20-ea-b10
Setting the property to false doesn't change anything.
This behavior appears in publicly released ea b10 and ea b11. It worked fine in ea b05.
Sadly, I can't think of any workaround, so I'll have to downgrade back to b05 as it breaks my application's functionality.
Code to reproduce:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ToggleButton;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class ToggleButtonFocus extends Application
{
@Override
public void start(final Stage stage) throws Exception
{
final ToggleGroup tg = new ToggleGroup();
final ToggleButton tb1 = createToggle("red");
final ToggleButton tb2 = createToggle("blue");
tb1.setToggleGroup(tg);
tb2.setToggleGroup(tg);
tg.selectToggle(tb1);
stage.setScene(new Scene(new HBox(tb1, tb2)));
stage.show();
}
private static ToggleButton createToggle(final String title)
{
final ToggleButton t = new ToggleButton(title);
t.setFocusTraversable(false);
t.setPrefWidth(100);
return t;
}
public static void main(final String[] args)
{
Application.launch(args);
}
}
This behavior appears in publicly released ea b10 and ea b11. It worked fine in ea b05.
Sadly, I can't think of any workaround, so I'll have to downgrade back to b05 as it breaks my application's functionality.
Code to reproduce:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ToggleButton;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class ToggleButtonFocus extends Application
{
@Override
public void start(final Stage stage) throws Exception
{
final ToggleGroup tg = new ToggleGroup();
final ToggleButton tb1 = createToggle("red");
final ToggleButton tb2 = createToggle("blue");
tb1.setToggleGroup(tg);
tb2.setToggleGroup(tg);
tg.selectToggle(tb1);
stage.setScene(new Scene(new HBox(tb1, tb2)));
stage.show();
}
private static ToggleButton createToggle(final String title)
{
final ToggleButton t = new ToggleButton(title);
t.setFocusTraversable(false);
t.setPrefWidth(100);
return t;
}
public static void main(final String[] args)
{
Application.launch(args);
}
}