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

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -