Any way to take screenshot of URL in java

1k views Asked by At

Please suggest the way to take screenshot of URL/HTMLFile in java. I am trying with LOBO Browser and able to Open URL in jframe but not able to take screenshot of content inside jframe. Please check code sample

import org.lobobrowser.gui.FramePanel;

public LoboTestFrame() throws Exception {
    FramePanel framePanel = new FramePanel();

    this.getContentPane().add(framePanel);
    framePanel.navigate("http://en.wikipedia.org/wiki/Main_Page");

}

Not able to capture loaded content as image

1

There are 1 answers

3
trashgod On

Yes. Combine Desktop#browse(), mentioned here, with Robot#createScreenCapture(), illustrated here and here.