Skip to content

kugtong33/fxQuery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fxQuery Gitter chat Build Status Codeship Status for Lintad/fxQuery

jQuery inspired JavaFX library for UI-Controller development

The project is an effort for easier JavaFX UI-Controller development that uses the idea of jQuery by calling node Ids and manipulate fxml elements same as DOM elements.

How to use:

  • Get the root pane of the fxml page(in this instance an AnchorPane)
  • Add an id on the node you want to use
  • Put a functionality by using the existing API built under the fxQuery

Example Code:

  /* Sample JavaFX Controller File */
  @FXML AnchorPane anchorpane /* An AnchorPane with with fx:id anchorPane */
  
  public void initialize(URL url, ResourceBundle rb){
    
      FXQuery fxQuery = new FXQuery(anchorPane);
      
      /* A Button with id sample-button-id  */
      fxQuery.$("#sample-button-id").click(new EventHandler<MouseEvent>(){
      
          @Override
          public void handle(MouseEvent event){
              /* Do something wild here */
          }

      });  

  }

Any node which is inside the given container(in this case an AnchorPane) can be automatically used by getting the id and put it in the selector function, which is the $("#element-id") method;

About

jQuery inspired JavaFX library for UI-Controller development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages