/** * init fxml when loaded. */ @PostConstruct public void init() throws Exception { final Stage stage = (Stage) context.getRegisteredObject("Stage"); glyphDetailViewer = new GlyphDetailViewer(); detailsContainer.getChildren().add(glyphDetailViewer); ScrollPane scrollableGlyphs = allGlyphs(); scrollableGlyphs.setStyle(FX_BACKGROUND_INSETS_0); iconsContainer.getChildren().add(scrollableGlyphs); browseFont.setOnAction((action) -> { FileChooser fileChooser = new FileChooser(); FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("SVG files (*.svg)", "*.svg"); fileChooser.getExtensionFilters().add(extFilter); File file = fileChooser.showOpenDialog(stage); if (file != null) { SVGGlyphLoader.clear(); try { SVGGlyphLoader.loadGlyphsFont(new FileInputStream(file), file.getName()); ScrollPane newglyphs = allGlyphs(); newglyphs.setStyle(FX_BACKGROUND_INSETS_0); iconsContainer.getChildren().clear(); iconsContainer.getChildren().add(newglyphs); } catch (IOException ioExc) { ioExc.printStackTrace(); } } }); }