我的CheckBox中的下划线在哪里? [英] where is the underscore in my CheckBox?

查看:266
本文介绍了我的CheckBox中的下划线在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显示我的问题的最短程序:

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();
    }
}

导致:

在SceneBuilder中,通过比较它正常显示,但不在我的应用程序中。我正在运行Java 1.8.0-b129

In SceneBuilder by comparison it´s displayed normally, but not in my application. I am running Java 1.8.0-b129

任何提示?

推荐答案

你可能想要 setMnemonicParsing false

MnemonicParsing属性,用于启用/禁用文本解析。如果将其设置为true,则将解析Label文本以查看它是否包含助记符解析字符_。当检测到助记符时,将根据后续字符确定组合键,并添加助记符。

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.

Labeled的默认值为false,但是由某些控件上的默认值。

The default value for Labeled is false, but it is enabled by default on some Controls.

这篇关于我的CheckBox中的下划线在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆