FlexGanttFX Developer Manual : 1. Installation

Step 1: Download and Install Java 8

Download JDK 8 and run the installer. Java 8 includes JavaFX 8.

Step 2. Download the FlexGanttFX distribution

Go to the downloads section of http://www.dlsc.com and download the latest release of FlexGanttFX. The download file will be a ZIP archive containing the required JAR files, demos, tutorials, API documentation, etc...

Step 3. Unpack the distribution

Unzip the distribution to your local file system. Once upacked you will see the following content:

The distribution contains the following subfolders:

  • css - copies of the stylesheets used by FlexGanttFX (the originals are included in the JAR file)
  • demos - several runnable jar files, simply double click to run or call "java -jar xxx-demo.jar" (make sure to use Java 8u60+)
  • docs - the API documentation of FlexGanttFX
  • ext - third-party JAR files required for running FlexGanttFX
  • legal - the license agreements as PDF files
  • lib - the FlexGanttFX libraries
  • tutorial - files to get you started

Step 4. Add JAR files to classpath

Assuming that you downloaded release 1.6.0 then add the following files (located in the distribution's lib folder) to your classpath.

  • flexganttfx-core-1.6.0.jar - contains various utility classes and the licensing support
  • flexganttfx-model-1.6.0.jar - all classes related to the data model (activities, rows, repositories)
  • flexganttfx-view-1.6.0.jar - the view classes, such as the actual Gantt Chart control
  • flexganttfx-extras-1.6.0.jar - additional classes such as a toolbar and a statusbar

Add the files located in the ext folder to your classpath.

  • controlsfx.jar - the distribution of the ControlsFX project
  • license4j.jar - code for supporting the licensing concepts

Step 5. Create application class

The following listing shows the most basic setup that is required to launch a Gantt chart user interface.

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;
 
import com.flexganttfx.view.GanttChart;
 
public class MyFirstGanttChart extends Application {
 
  @Override
  public void start(Stage stage) throws Exception {
 
	// <- Our Gantt chart
    GanttChart<?> gantt = new GanttChart<>(); 
    
    Scene scene = new Scene(gantt);
    
    stage.setScene(scene);
    stage.centerOnScreen();
    stage.sizeToScene();
    stage.show();    
  }
 
  public static void main(String[] args) {
    Application.launch(args);
  }
}

Attachments: