How to use Java FX MetroUI and Development Library
In this issue, Xiaobian will bring you about how to use Java FX MetroUI and development libraries. The article is rich in content and analyzed and described from a professional perspective. After reading this article, I hope you can gain something.
Metro UI For JavaFX!
This is a Windows design style UI library, very simple to use, as long as a line of code can achieve the overall UI style replacement!
new JMetro(JMetro.Style.LIGHT).applyTheme(scene);
example
Switch
Button
A description of the Jmetro project and how to use it can be found on his blog.
ConsrolsFX
This is a JavaFX control extension library, interface style and JavaFX native consistent, based on JavaFX added many useful controls.
Very powerful and configurable.
Github :
https://github.com/controlsfx/controlsfx
Use of 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; } }); }
Use:
notification("message", "start scanning", "info");
The above is how to use Java FX MetroUI and development libraries shared by Xiaobian for everyone. If you happen to have similar doubts, you may wish to refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.