package editor;

import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;

public class ImageSelector {
	private HBox imageSelector;
	private ImageView img;
	private final String defaultEnemy = "enemy_soldier_1.jpg";

	public ImageSelector() {
		imageSelector = new HBox();
		img = new ImageView(new Image(getClass().getClassLoader().getResourceAsStream(defaultEnemy)));
		img.setFitWidth(100.1);
		img.setFitHeight(100.1);
		
		Button selectImage = new Button("Load Image");
		imageSelector.setSpacing(20);
		imageSelector.getChildren().addAll(selectImage, img);
	}
	
	public HBox getNode() {
		return imageSelector;
	}

}

@@ -10,16 +10,105 @@
 ditor;%0A%0A
+import java.io.File;%0A%0Aimport javafx.event.ActionEvent;%0Aimport javafx.event.EventHandler;%0A
 import j
@@ -237,16 +237,76 @@
 ut.HBox;
+%0Aimport javafx.stage.FileChooser;%0Aimport javafx.stage.Stage;
 %0A%0Apublic
@@ -439,10 +439,10 @@
 r_1.
-j
 p
+n
 g%22;%0A
@@ -468,16 +468,53 @@
 tor() %7B%0A
+%09public ImageSelector(Stage stage) %7B%0A
 %09%09imageS
@@ -688,16 +688,17 @@
 .1);%0A%09%09%0A
+%0A
 %09%09Button
@@ -738,16 +738,275 @@
 mage%22);%0A
+%09%09selectImage.setOnAction(new EventHandler%3CActionEvent%3E() %7B%0A%09%09%09@Override%0A%09%09%09public void handle(final ActionEvent e) %7B%0A%09%09%09%09FileChooser fileChooser = new FileChooser();%0A%09%09%09%09File file = fileChooser.showOpenDialog(stage);%0A%09%09%09%09if (file != null) %7B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D);%0A
 %09%09imageS
@@ -1089,13 +1089,15 @@
 g);%0A
+%0A
 %09%7D%0A%09%0A
+%0A
 %09pub
@@ -1148,7 +1148,4 @@
 %0A%09%7D%0A
-%0A%7D%0A

Update ImageSelector.java