Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void saveAsPng() {
- WritableImage image = barChart.snapshot(new SnapshotParameters(), null);
- // TODO: probably use a file chooser here
- File file = new File("chart.png");
- try {
- ImageIO.write(SwingFXUtils.fromFXImage(image, null), "png", file);
- } catch (IOException e) {
- // TODO: handle exception here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement