You are on page 1of 1

try {

Stage chooseStage = new Stage();

fileChooser = new FileChooser();


fileChooser.getExtensionFilters().addAll(
new FileChooser.ExtensionFilter("Text Files", "*txt"),
new FileChooser.ExtensionFilter("Image Files", "*.PNG",
"*.JPG", "*.JPEG"),
new FileChooser.ExtensionFilter("All Files", "*.*")
);

filesketch = fileChooser.showOpenDialog(chooseStage);
if (filesketch != null){
desktop.open(filesketch);
path.setText(filesketch.getAbsolutePath());
imgpath = new Image(filesketch.toURI().toString());
imgview.setImage(imgpath);
}
}catch (IOException e1){

Logger.getLogger(SuperviserFXMLContoller.class.getName()).log(Level.SEVERE, null,
e1);
}

You might also like