JAVAFX 第三方庫 布局 小工具 美化 測試 UI 框架 推薦


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

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2026 CODEPRJ.COM