Skip to content
MDI components for JavaFX
Branch: master
Clone or download
Latest commit e3ff4da Mar 22, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle Mixed updates Feb 12, 2019
screenshots Add screenshot to readme Jul 14, 2018
subprojects Mixed updates Feb 12, 2019
.gitignore
.travis.yml Mixed updates Feb 12, 2019
LICENSE.txt
README.adoc Upadte README.adoc Mar 21, 2019
build.gradle Mixed updates Feb 12, 2019
gradle.properties
gradlew Mixed updates Feb 12, 2019
gradlew.bat
settings.gradle Mixed updates Feb 12, 2019

README.adoc

DesktopPaneFX

Build Status (travis) ASL2 Licensed download desktoppanefx core donations Patreon orange


JDesktopPaneFX is a JavaFX version of Swing’s JDesktopPane which can be used as a container for individual "child" similar to JInternalFrames.

This project started as a fork of JavaFXMDI authored by Lincoln Minto.

desktoppanefx

Installing

You can get the latest version of DesktopPaneFX directly from Bintray’s JCenter repository or Maven Central.

gradle
repositories {
    jcenter()
}

dependencies {
    compile 'org.kordamp.desktoppanefx:desktoppanefx-core:0.12.0'
}
maven
<dependencies>
    <dependency>
        <groupId>org.kordamp.desktoppanefx</groupId>
        <artifactId>desktoppanefx-core</artifactId>
        <version>0.12.0</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>central</id>
        <name>jcenter</name>
        <url>http://jcenter.bintray.com</url>
    </repository>
</repositories>

Java 9+

DesktopPaneFX can be used in a modular fashion when running in Java9+. It’s module name is org.kordamp.desktoppanefx.core.

Example

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import org.kordamp.desktoppanefx.scene.layout.DesktopPane;
import org.kordamp.desktoppanefx.scene.layout.InternalWindow;
import org.kordamp.ikonli.javafx.FontIcon;

public class Example extends Application {
    private static int count = 0;

    @Override
    public void start(Stage stage) throws Exception {
        DesktopPane desktopPane = new DesktopPane();
        Button newWindow = new Button("New Window");
        newWindow.setOnAction(e -> {
            InternalWindow window = new InternalWindow(
                "window-" + count,
                new FontIcon("mdi-application:20"),
                "Title " + count++,
                new Label("Content"));
            desktopPane.addInternalWindow(window);
        });

        BorderPane mainPane = new BorderPane();
        mainPane.setPrefSize(800, 600);
        mainPane.setTop(newWindow);
        mainPane.setCenter(desktopPane);

        stage.setScene(new Scene(mainPane));
        stage.show();
    }
}

Incubating Features

The following features can be activated by defining a System property with a "true" value:

Property

Description

desktoppanefx.detachable.windows

InternalWindow may be detached/attached from/to a DesktopPane

Building

You must meet the following requirements:

  • JDK8u172 as a minimum [1]

  • Gradle 4.10

You may used the included gradle wrapper script if you don’t have gradle installed.

Installing Gradle

Manual
  1. Download Gradle from http://gradle.org/downloads

  2. Unzip the file into a directory without spaces (recommended).

  3. Create a GRADLE_HOME environment variable that points to this directory.

  4. Adjust your PATH environment variable to include $GRADLE_HOME/bin (%GRADLE_HOME%\bin on Windows).

  5. Test your setup by invoking gradle --version.

SDKMAN
  1. Follow the instructions found at http://sdkman.io/ to install SDKMAN.

  2. You need a POSIX environment if running Windows. We recommend using Babun Shell (http://babun.github.io/)

  3. Once SDKMAN is installed invoke sdk install gradle 4.10.

  4. Test your setup by invoking gradle --version.

Gdub

GDub is a wrapper script that facilitates invoking gradle tasks anywhere within a Gradle project. It’s smart enough to use the gradle wrapper if available or your global gradle command. This is an optional download.

  1. Follow the instructions found at https://github.com/dougborg/gdub to install gdub

Next Steps

Make a full build issuing gradle build.

Run the sampler JavaFX application by invoking the following command

$ cd subprojects/sampler
$ gradle run

Contributing

If you are interested in fixing issues and contributing directly to the code base, please contact us!

License


1. Using the incubating feature for attaching and detaching windows leads to a styling issue for JDK8u102 to JDK8u171 (see https://bugs.openjdk.java.net/browse/JDK-8183100)
You can’t perform that action at this time.