JFoenix中文教程:2、JFXButton按钮组件

JFoenix提供的按钮组件为JFXButton,JFXButton提供了两种按钮形式:FLAT、RAISED,默认是 FLAT。

首先,先看一组按钮效果:

JFXButton效果

对应源码如下:

<JFXButton layoutX="50" layoutY="40" prefWidth="200" prefHeight="50" buttonType="FLAT" text="FLAT 按钮 无底色" style="-fx-font-size: 14px;"/>

<JFXButton layoutX="300" layoutY="40" prefWidth="200" prefHeight="50" buttonType="FLAT" text="FLAT 按钮 有底色" style="-fx-font-size: 14px; -fx-background-color: #F4A460;"/>

<JFXButton layoutX="550" layoutY="40" prefWidth="200" prefHeight="50" buttonType="FLAT" text="FLAT 按钮 禁用" style="-fx-font-size: 14px; -fx-background-color: #F4A460;" disable="true"/>

<JFXButton layoutX="50" layoutY="120" prefWidth="200" prefHeight="50" buttonType="RAISED" text="RAISED 按钮 无底色" style="-fx-font-size: 14px;"/>

<JFXButton layoutX="300" layoutY="120" prefWidth="200" prefHeight="50" buttonType="RAISED" text="RAISED 按钮 有底色" style="-fx-font-size: 14px; -fx-background-color: #F4A460;"/>

<JFXButton layoutX="550" layoutY="120" prefWidth="200" prefHeight="50" buttonType="RAISED" text="RAISED 按钮 禁用" style="-fx-font-size: 14px; -fx-background-color: #F4A460;" disable="true"/>

以上,可以看出,FLAT 属性是常规按钮,RAISED 是一种带有阴影效果的按钮样式,两者在点击时均有动态效果。

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值