Skip to content

Instantly share code, notes, and snippets.

@kaecy
Forked from hatimmohammed369/Miniturized.java
Last active March 8, 2018 18:51
Show Gist options
  • Save kaecy/b9dde6b8145175de6d78f5559215ded3 to your computer and use it in GitHub Desktop.
Save kaecy/b9dde6b8145175de6d78f5559215ded3 to your computer and use it in GitHub Desktop.
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.*;
import javafx.scene.control.*;
import javafx.scene.image.*;
import javafx.geometry.*;
public class miniturized extends Application {
@Override
public void start(Stage primaryStage) {
BorderPane layout = new BorderPane();
VBox bbox = new VBox();
Image image = new Image(getClass().getResourceAsStream("circle.png"));
ImageView imgview = new ImageView(image);
bbox.setAlignment(Pos.TOP_RIGHT);
bbox.getChildren().add(imgview);
layout.setTop(bbox);
Scene scene = new Scene(layout, 100, 100);
primaryStage.setScene(scene);
//stage.initStyle(StageStyle.UNDECORATED); don't do this if you aren't going to implement the stuff a user expects from a window
primaryStage.show();
}
public static void main(String[] arguments) {
launch(arguments);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment