Skip to content

kordamp/desktoppanefx

Repository files navigation

DesktopPaneFX

Build Status desktoppanefx core


DesktopPaneFX 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 {
    implementation 'org.kordamp.desktoppanefx:desktoppanefx-core:0.15.0'
}
maven
<dependencies>
    <dependency>
        <groupId>org.kordamp.desktoppanefx</groupId>
        <artifactId>desktoppanefx-core</artifactId>
        <version>0.15.0</version>
    </dependency>
</dependencies>

org.kordamp.desktoppanefx.sampler.Example

package com.acme;

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:

  • JDK11 as a minimum

  • Gradle 6.3

You may use 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 6.3.

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

Gum

Gum 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/kordamp/gm to install gum

Next Steps

Make a full build issuing gm build.

Run the sampler JavaFX application by invoking the following command

$ gm :sampler:run

Contributing

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

License