JavaFX - Vivoxa Labs custom stage

Maven Vivoxa Labs custom stage

<dependencies>
	<dependency>
		<groupId>org.openjfx</groupId>
		<artifactId>javafx-controls</artifactId>
		<version>18.0.1</version>
	</dependency>
	<dependency>
		<groupId>org.openjfx</groupId>
		<artifactId>javafx-fxml</artifactId>
		<version>18.0.1</version>
	</dependency>
	<dependency>
		<groupId>lk.vivoxalabs.customstage</groupId>
		<artifactId>CustomStage</artifactId>
		<version>1.3.2</version>
	</dependency>
</dependencies>

Module CustomStage

module fr.ronanlefichant.customstage {
    requires javafx.controls;
    requires CustomStage;
    requires javafx.fxml;
    exports fr.ronanlefichant.customstage;
}

Java CustomStage

import java.io.IOException;

import javafx.application.Application;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import lk.vivoxalabs.customstage.CustomStage;
import lk.vivoxalabs.customstage.CustomStageBuilder;

/**
 * JavaFX App
 */
public class App extends Application {

  @Override
  public void start(Stage primaryStage) throws IOException {

    Label label = new Label("Test");

    CustomStage stage = new CustomStageBuilder().setWindowTitle("Exemple CustomStage") // Titre
      .setTitleColor("white") // Couleur du titre
      .setWindowColor("blue") // Couleur de la fenêtre
      .build();

    // Ajoute la scene
    stage.changeScene(new StackPane(label));
    stage.show();
  }

  public static void main(String[] args) {
    launch();
  }

}

Commentaires