Scroll down a notepad file using java -


i want scroll down notepad file in order capture screenshots, when try capture screenshot able capture visible part, have tried multiple ways nothing seems work. can suggest solution this? in advance!! i'm using below code

        jframe frame = new jframe();         frame.setsize(200, 200);         frame.setvisible(true);          try {             thread.sleep(2000);         } catch (interruptedexception e) {             throw new runtimeexception(e);         }          robot robot = new robot();          robot.keypress(keyevent.vk_alt);         robot.keypress(keyevent.vk_printscreen);         robot.keyrelease(keyevent.vk_printscreen);         robot.keyrelease(keyevent.vk_alt);          try {             thread.sleep(2000);         } catch (interruptedexception e) {             throw new runtimeexception(e);         }          string shot = "screenshot"+com.getuniquename()+".png";         transferable t = toolkit.getdefaulttoolkit().getsystemclipboard().getcontents(null);         renderedimage image = (renderedimage)t.gettransferdata(dataflavor.imageflavor);          boolean issuccess = imageio.write(image, "png", new file(sora_constants.shots+shot));          system.out.println(issuccess); 

is notepad window in focus? presume if you're trying screen shots it. try clicking down.

robot.keypress(keyevent.vk_down); robot.keyrelease(keyevent.vk_down); 

Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -