The shortest possible program to show my problem:
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.layout.Priority;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TestCheckBox extends Application {
public static void main(String[] args) {
launch(args);
}
public void start(Stage stage) {
Scene scene = new Scene(new StackPane());
final VBox vbox = new VBox();
vbox.getChildren().addAll(new Label("ABC_DEF"), new CheckBox("ABC_DEF"));
((StackPane) scene.getRoot()).getChildren().add(vbox);
stage.setScene(scene);
stage.show();
}
}
leads to:
In SceneBuilder by comparison it´s displayed normally, but not in my application. I am running Java 1.8.0-b129
Any hint?
You probably want to setMnemonicParsing to false
on the CheckBox.
MnemonicParsing property to enable/disable text parsing. If this is set to true, then the Label text will be parsed to see if it contains the mnemonic parsing character '_'. When a mnemonic is detected the key combination will be determined based on the succeeding character, and the mnemonic added.
The default value for Labeled is false, but it is enabled by default on some Controls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With