小编use*_*222的帖子

我的CheckBox中的下划线在哪里?

用于显示问题的最短程序:

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();
    }
}
Run Code Online (Sandbox Code Playgroud)

导致:

在此输入图像描述

相比之下,在SceneBuilder中它正常显示,但不在我的应用程序中.我正在运行Java 1.8.0-b129

任何提示?

checkbox javafx javafx-8

7
推荐指数
1
解决办法
1463
查看次数

标签 统计

checkbox ×1

javafx ×1

javafx-8 ×1