JAVAFX 第三方库 布局 小工具 美化 测试 UI 框架 推荐

原帖地址

https://zeroturnaround.com/rebellabs/best-javafx-libraries-for-beautiful-apps-and-clean-code/

布局

MigLayout

MigLayout基于字符串以及API类型构造简单的布局,如果你经常遇到要调整几个组件之间的margin,那么它会简化你的工作。 
http://miglayout.com/ 
如下图,使用简单的代码就可以生成如下的布局,他们白色间隙都是自动添加的

  1.  
    JPanel panel = new JPanel(new MigLayout());
  2.  
     
  3.  
    panel.add(firstNameLabel);
  4.  
    panel.add(firstNameTextField);
  5.  
    panel.add(lastNameLabel, “gap unrelated”);
  6.  
    panel.add(lastNameTextField, “wrap”);
  7.  
    panel.add(addressLabel);
  8.  
    panel.add(addressTextField, “span, grow”);
  •  

小工具

Medusa

http://github.com/HanSolo/Medusa

TilesFX

https://github.com/HanSolo/tilesfx

JSilhouette

http://github.com/aalmiray/jsilhouette

JideFX

http://github.com/jidesoft/jidefx-oss

RichTextFX

http://github.com/TomasMikula/RichTextFX

JFXtras

http://jfxtras.org/

ControlsFX

http://fxexperience.com/controlsfx

Gluon Maps

http://github.com/gluonhq/maps

OrsonCharts

http://www.object-refinery.com/orsoncharts

UI

http://github.com/jfoenixadmin/JFoenix

JFoenix

http://github.com/jfoenixadmin/JFoenix

BootstrapFX

很多人都在想能不能在JAVAFX有类似Bootstrap一样的CSS库,现在BootstrapFX就符合这个需求。 
使用它只需要在scene加入它即可。如下:

  1.  
     
  2.  
    public class Sampler extends Application {
  3.  
    @Override
  4.  
    public void start(Stage primaryStage) throws Exception { (1)
  5.  
    Panel panel = new Panel(“This is the title”);
  6.  
    panel.getStyleClass().add(“panel-primary”); (2)
  7.  
    BorderPane content = new BorderPane();
  8.  
    content.setPadding(new Insets(20));
  9.  
    Button button = new Button(“Hello BootstrapFX”);
  10.  
    button.getStyleClass().setAll(“btn”,“btn-danger”); (2)
  11.  
    content.setCenter(button);
  12.  
    panel.setBody(content);
  13.  
     
  14.  
    Scene scene = new Scene(panel);
  15.  
    scene.getStylesheets().add(“bootstrapfx.css”); (3)
  16.  
     
  17.  
    primaryStage.setTitle(“BootstrapFX”);
  18.  
    primaryStage.setScene(scene);
  19.  
    primaryStage.sizeToScene();
  20.  
    primaryStage.show();
  21.  
    }
  22.  
    }



http://github.com/aalmiray/bootstrapfx

FontawesomeFX

http://bitbucket.org/Jerady/fontawesomefx 

FontawesomeFX是一款基于JAVAFX的图标库。 
引入:

  1.  
    <dependency>
  2.  
    <groupId>de.jensd</groupId>
  3.  
    <artifactId>fontawesomefx</artifactId>
  4.  
    <version>8.9</version>
     
  5. </dependency> 

如何在FXML下使用?

<FontAwesomeIcon name="WARNING" /> 

更多使用方法查看源码

Ikonli

https://aalmiray.github.io/ikonli/

测试

TestFX

https://github.com/TestFX/TestFX

构架

Afterburner.fx

http://afterburner.adam-bien.com/

JacpFX

http://jacpfx.org/

MvvmFX

http://github.com/sialcasa/mvvmFX

Griffon

http://griffon-framework.org/

Basilisk

http://github.com/basilisk-fw/basilisk