This is a really strange bug, but anytime I try to put text with underscores on any JavaFX node besides Labels (Buttons, Checkboxes, etc) the first underscore is never rendered.
Simple example to illustrate my point:
package application;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.TilePane;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) {
try {
BorderPane root = new BorderPane();
Scene scene = new Scene(root, 400, 400);
TilePane tp = new TilePane();
root.setCenter(tp);
for (int i = 0; i < 10; i++) {
Button b = new Button("Underscores_Do_Not_Show_Right");
tp.getChildren().add(b);
}
primaryStage.setScene(scene);
primaryStage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
}
This seems like a JavaFX bug, but does anyone know of a workaround? For Checkboxes I simply put a Label next to a text-less Checkbox. With Buttons, however, this is not an option.
