Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anivie/elementfx
ElementUi in javafx,that you can get a beautiful applications with only one line code.
https://github.com/anivie/elementfx
java javafx javafx-components javafx-gui javafx-library kotlin
Last synced: 4 months ago
JSON representation
ElementUi in javafx,that you can get a beautiful applications with only one line code.
- Host: GitHub
- URL: https://github.com/anivie/elementfx
- Owner: Anivie
- License: apache-2.0
- Created: 2022-06-07T02:54:31.000Z (over 2 years ago)
- Default Branch: element
- Last Pushed: 2022-12-02T13:44:33.000Z (about 2 years ago)
- Last Synced: 2024-09-29T03:40:49.936Z (4 months ago)
- Topics: java, javafx, javafx-components, javafx-gui, javafx-library, kotlin
- Language: CSS
- Homepage:
- Size: 729 KB
- Stars: 28
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ElementFX
ElementUi in javafx,that you can get a beautiful applications with only one line code.
JavaFX版本的ElementUi,您可以仅需一行代码而轻松美化您的JavaFX应用### Usage:
For Java:
```
Button button = new Button();
ElementButtonKt.theme(button, ElementButton.grayButton);
Scene scene = new Scene(root);
scene.getStylesheets().add(CssResources.globalCssFile);
scene.getStylesheets().add(CssResources.buttonCssFile);//可选,用于每个组件可单独调整主题
/*
or:
CssResourcesKt.themes(scene, (strings, cssResources) -> {
strings.add(CssResources.globalCssFile);
strings.add(CssResources.buttonCssFile);
return null;
});
*/
primaryStage.setScene(scene);
primaryStage.setTitle("ElementForJavaFX");
primaryStage.show();
```
For Kotlin:
```
primaryStage.run {
scene = Scene(root,400.0,400.0).apply {
themes {
this += it.globalCssFile
this += it.buttonCssFile//可选,用于每个组件可单独调整主题
}
}
title = "ElementForJavaFX"
show()
}
```### Note:
本项目尚未在仓库中发布,您可以自行在out/production/resources/cloud_css中找到您需要的css文件通过JavaFx的api自行引入
也可以在release中下载预览版本通过本地导入的方式引用
具体用法请查看demoThis project has not yet been released in the maven,but you can find the css file you need in out/production/resources/cloud_css and import it by JavaFx api.
You can also download the preview version in the release and importing in locally way.
Please refer to the demo for details.## 当前支持的组件(Supported nodes):
> + Button
> + TextField
> + ListView
> + TextArea
> + Label
> + ComboBox
> + CheckBox
> + ScrollPane
> + ScrollBar
> + DatePicker
> + TableView
> + Spinner
> + TabPane
> + Pagination
> + ContextMenu
> + Slider
> + ProgressBar
> + TreeView#### 示例效果:
![Screen](screenshot/screen_1.0.png)
Demo path is : src/test/kotlin/testapp/Demo.kt### todo:
为每个组件单独调整主题。
Change themes individually for nodes.
```
val regButton = Button("Register").apply {
theme(ElementButton.orangeButton)
}
```
NOTE:当前仅支持TextField和Button