show screenshots in tutorial
|
@ -1,6 +1,7 @@
|
||||||
package ch.zhaw.gartenverwaltung;
|
package ch.zhaw.gartenverwaltung;
|
||||||
|
|
||||||
|
|
||||||
|
import ch.zhaw.gartenverwaltung.io.PlantList;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
|
@ -8,6 +9,7 @@ import javafx.scene.image.ImageView;
|
||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controller class for the Tutorial.fxml file
|
* Controller class for the Tutorial.fxml file
|
||||||
|
@ -46,10 +48,10 @@ public class TutorialController {
|
||||||
* @param fileName the file name of the source
|
* @param fileName the file name of the source
|
||||||
*/
|
*/
|
||||||
private void setImageView(ImageView imageView, String fileName) {
|
private void setImageView(ImageView imageView, String fileName) {
|
||||||
File file = new File(String.valueOf(PlantsController.class.getResource(fileName)));
|
InputStream is = PlantsController.class.getResourceAsStream("screenshots/" + fileName);
|
||||||
Image image;
|
Image image;
|
||||||
if (file.exists()) {
|
if (is != null) {
|
||||||
image = new Image(String.valueOf(PlantsController.class.getResource(fileName)));
|
image = new Image(String.valueOf(PlantsController.class.getResource("screenshots/" + fileName)));
|
||||||
} else {
|
} else {
|
||||||
image = new Image(String.valueOf(PlantsController.class.getResource("placeholder.png")));
|
image = new Image(String.valueOf(PlantsController.class.getResource("placeholder.png")));
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |