intial commit

This commit is contained in:
nora 2020-11-16 21:52:17 +01:00
commit c51255f381
20 changed files with 316 additions and 0 deletions

View file

@ -0,0 +1,24 @@
package sample;
import javafx.event.ActionEvent;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
public class Controller {
public ImageView setPreview;
int currentFrame;
public void showImage(ActionEvent actionEvent) throws FileNotFoundException {
InputStream stream = new FileInputStream("C:\\Users\\nilsh\\IdeaProjects\\testStuff\\sequence/Sequence" + currentFrame + ".png");
Image image = new Image(stream);
setPreview.setImage(image);
currentFrame++;
}
}

24
src/sample/Main.java Normal file
View file

@ -0,0 +1,24 @@
package sample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Mandelbrot");
primaryStage.setScene(new Scene(root, 1800, 900));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}

7
src/sample/sample.css Normal file
View file

@ -0,0 +1,7 @@
.root {
-fx-background-color: #AAAABA;
}
.label {
-fx-font-size: 25;
}

17
src/sample/sample.fxml Normal file
View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<GridPane alignment="center" hgap="10.0" prefHeight="143.0" prefWidth="107.0" stylesheets="/sample/sample.css" vgap="10" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.Controller">
<Button onAction="#showImage" prefHeight="25.0" prefWidth="110.0" text="Start" GridPane.rowIndex="1" />
<ImageView fx:id="setPreview" fitWidth="1000" preserveRatio="true" />
<columnConstraints>
<ColumnConstraints />
</columnConstraints>
<rowConstraints>
<RowConstraints />
<RowConstraints />
</rowConstraints>
</GridPane>