【发布时间】:2018-08-22 13:02:10
【问题描述】:
我正在学习如何将 JFoenix 与 Java FX 一起使用。 我在 SceneBuilder 中使用它,所以我可以显示的唯一代码就是那个:
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXToggleButton?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<SplitPane id="sp_main" dividerPositions="0.29797979797979796" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.171">
<items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children>
<VBox layoutX="-1.0" prefHeight="398.0" prefWidth="174.0">
<children>
<Pane prefHeight="200.0" prefWidth="200.0" />
<Pane prefHeight="200.0" prefWidth="200.0" />
<Pane id="p_action" prefHeight="200.0" prefWidth="200.0">
<children>
<VBox prefHeight="200.0" prefWidth="100.0" />
<JFXToggleButton />
</children>
</Pane>
</children>
</VBox>
</children></AnchorPane>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0" />
</items>
</SplitPane>
根据文档,当我们使用 JFXToggleButton 组件时,应该有某种开关按钮,例如:
但这不是我所拥有的,我所能得到的只是一个简单的切换按钮,例如:
我有什么遗漏吗?非常感谢。
注意: JavaFX 场景生成器 8.5.0 使用 Maven 从库管理器手动添加 JFoenix 8.0.7 文档:https://github.com/jfoenixadmin/JFoenix/wiki/Toggle-Button#JFXButton
【问题讨论】:
标签: javafx-8 togglebutton uiswitch jfoenix