简体   繁体   中英

Any way to take screenshot of URL in java

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM