[Warning: this documentation might be slightly out-of-date. Check the code repository, check the samples sub-project. New controls and features might already have been added that are not present in this documentation page]

This is a Java library that contains a collection of new controls to be used in JavaFX applications.

As of the time of writing of this documentation page, FXComponents is being built using Java 21 (the latest LTS Java release) and JavaFX 22.

Some of the examples in this page are going to be shown with the JMetro theme or Transit theme applied for a better visual impact. But you don’t need to use JMetro or Transit, you can use your own theme.

If you want to see code examples on how to use the Controls in this library, check the “FXComponents-samples” sub-project inside the repository. It has some small example applications using these Controls. The code is available on Github.

How to get it

This library is available on Maven Central.

Gradle example:

 implementation 'com.pixelduke:FXComponents:1.6' 

Maven example:

 
<dependency>
    <groupId>com.pixelduke</groupId>
    <artifactId>FXComponents</artifactId>
    <version>1.6</version>
</dependency>

Replace version number with the one you’d want.

Running the sample demos

To run the demos, enter the following command in the Command Prompt / Terminal, inside the project directory:

gradlew run

Be sure to have your JAVA_HOME environment variable correctly set.
To choose which of the demos to run, change the “gradle.build” script file inside “FXComponents-samples” folder and uncomment which Application derived class you’d like to execute.

License

FXComponents license is “GNU General Public License, version 2, with the Classpath Exception’“

Request for feedback

If you’re using FXComponents please send pictures of your app to .

If you can, ideally, please also share it through social media (Twitter) and let me know (you can reference me through my twitter handle @P_Duke and you can also use the #FXComponents tag). It will be very important to check how you are using FXComponents and adjust it to better fit the use cases. Also, for showcasing example uses (if you allow).

It is also important for me, and to keep me motivated to continue, to know that FXComponents is being used and how it is being used.

Given all these unpaid work is given out for free, I just ask you to share it is being used and how if you can. 

Contributing

Contributions via Pull Requests (PR) are welcome! Help grow this library if you like it! Before filing a PR please create an issue in the issue tracker.

Controls

Navigation Pane

Presenting navigation where the navigation items are on the left, content on the right is very popular nowadays. Sometimes there’s also a chance to collapse the navigation items so they occupy less space.

NavigationPane control aims to facilitate the inclusion of a similar way of navigation, in your apps.

NavigationPane features

  1. As described, navigation items on the left, content on the right;
  2. Ability to shrink/expand menu items on the left (when items are shrunk only the icon is shown);
  3. Possibility to add footer menu items (these are placed on the bottom left);
  4. Toggle settings menu item visibility on or off;
  5. When menu items list is too big, a “minimalistic” ScrollPane is shown (uses FXSkins library internally);
  6. Possibility of having a hierarchy of menu items (child items inside menu items);
  7. Possibility of adding background blur around the control through the use of the FXThemes library;
  8. When items are shrunk, and they have child items a context menu is shown when they’re clicked so user can select child items;
  9. Animations all around for better visual aesthetics.

Following is a video of a sample app containing a NavigationPane control. The video illustrates the features that were mentioned.
The sample shown in the video is in the fxcomponents-samples sub project, in the fxcomponents repository.

List Builder

A control with 2 lists. A source list and a target list.

The target list will contain all the elements the user chose from the source list.

The user can drag and drop items from the source list onto the target list or use the buttons available to accomplish that.

Reordering of the lists is also possible through drag and drop.

Reordable ListView

A ListView that the user can reorder by drag and dropping each cell.

Blocking Progress Bar

A blocking dialog (blocks user input) that shows a progress bar while a background operation is in progress.

The ProgressBar can be of indeterminate progress or not.

The developer passes a Runnable to the showAndWait method. That Runnable will be executed in a background task, progress can be updated through convenience methods in the Task class API.

Indeterminate

Determinate