Skip to content

Instantly share code, notes, and snippets.

@aoetk
Created April 8, 2015 15:02
Show Gist options
  • Save aoetk/01dd84f4bc05ea26c13f to your computer and use it in GitHub Desktop.
Save aoetk/01dd84f4bc05ea26c13f to your computer and use it in GitHub Desktop.
Unified Styleのサンプル
package sample;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class UnifiedSampleApp extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
StackPane testPane = new StackPane();
testPane.setStyle("-fx-background-color:transparent;");
Label someText = new Label("TEXT AGAINST TRANSPARENT SCENE");
testPane.getChildren().add(someText);
Scene myScene = new Scene(testPane, 500, 500);
myScene.setFill(Color.TRANSPARENT);
primaryStage.setScene(myScene);
primaryStage.initStyle(StageStyle.UNIFIED);
primaryStage.setTitle("Application");
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment