目录 [隐藏]
- 1 Metro UI For JavaFX!
- 1.1 例子
- 1.2 Switch
- 1.3 Button
- 1.4 案例:
- 2 ConsrolsFX
- 3 Notification 的使用
Metro UI For JavaFX!
这是一个Windows设计风格的UI库,使用非常简单,只要一行代码就可以实现整体UI风格的替换!
new JMetro(JMetro.Style.LIGHT).applyTheme(scene);
例子
Switch
Button
案例:
可以看到,非常的美观!
可以在他的博客中查看 Jmetro 项目的说明和使用方式。
ConsrolsFX
这是一个JavaFX控件扩展库,界面风格与JavaFX原生一致,在JavaFX的基础上增加了许多实用的控件。
功能十分强大,可配置程度很高。
Github :
https:///controlsfx/controlsfx
Notification 的使用
private void notification(String title, String content, String type) {
Notifications notificationBuilder = Notifications.create()
.title(title)
.text(content)
.position(Pos.BASELINE_RIGHT)
.onAction(e -> System.out.println("Notification clicked on!"));
Platform.runLater(() -> {
switch (type) {
case "error":
notificationBuilder.showError();
break;
case "info":
notificationBuilder.showInformation();
break;
}
});
}
使用:
notification("信息", "开始扫描", "info");
效果:
用 JMetro 开发的界面: