0

I want full page snapshop of jpanel that have content larger than panel size so content is scrollable but I am unable to get snapshot of non visible area in JPanel. So far I have tried these codes

Container c = getContentPane();
BufferedImage img = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_INT_ARGB);
c.paint(img.getGraphics());
WritableImage snapshot = view.snapshot(new SnapshotParameters(), null);
RenderedImage renderedImage = SwingFXUtils.fromFXImage(snapshot, null);

and using Robot but none of them worked for me.

For clarification of what is happening: https://pasteboard.co/I9kup9w.png

Lokesh
  • 152
  • 1
  • 8
  • Although the title sounds different, this question seems to address the same problem: https://stackoverflow.com/questions/14551646/convert-a-jpanel-to-an-image-in-a-jscrollpane – Hans Apr 09 '19 at 11:49
  • not completely but this problem is same as mine : https://stackoverflow.com/questions/26433919/screenshot-of-the-full-web-page-loaded-into-javafx-webview-component-not-only-v – Lokesh Apr 10 '19 at 06:33

0 Answers0