Code Monkey home page Code Monkey logo

elementfx's Introduction

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中下载预览版本通过本地导入的方式引用
具体用法请查看demo

This 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
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

elementfx's People

Contributors

anivie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.