【问题标题】:buttons size increase controlsfx按钮大小增加controlsfx
【发布时间】:2015-09-22 21:03:29
【问题描述】:

可以增加对话框中按钮的大小。

我需要变得更大。

谢谢

【问题讨论】:

    标签: java javafx-2 controlsfx


    【解决方案1】:

    您可以通过访问您创建的对话框的 ButtonBar 来实现它,然后自定义其中的按钮。

    首先获取ButtonBar实例:

    ButtonBar buttonBar = (ButtonBar)yourDialogInstance.getDialogPane().lookup(".button-bar");
    

    然后将所有按钮应用到对话框窗格并通过包含 css 的字符串为它们设置样式。例如:

    buttonBar.getButtons().forEach(b->b.setStyle("-fx-font-size: 18px;"));
    

    更多细节:Customizing Dialogs

    【讨论】:

    • 感谢 grahan,但是发送按钮 Actions.OK,这个 Actions 可以改变风格??谢谢。
    • 没问题 :) 很抱歉,我不完全理解您的新问题。您想通过单击程序的其他按钮等操作来更改这些按钮的样式吗?
    猜你喜欢
    • 2014-07-03
    • 2012-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-24
    • 2011-11-07
    • 2013-12-30
    • 2023-03-25
    相关资源
    最近更新 更多