Isolate Posted April 12, 2015 Share Posted April 12, 2015 (edited) Trying to get the canvas bounds here, x and y are always 0.Any way to find the real position (Edit: gives the bounds of the canvas on the client ,not on the screen, looking for a way to get a box around the client or just the windows) Edited April 12, 2015 by Isolate Quote Link to comment Share on other sites More sharing options...
fixthissite Posted April 12, 2015 Share Posted April 12, 2015 (edited) Please show your code so it can be identified easier, more preferrably, a MCVE Edited April 12, 2015 by fixthissite Quote Link to comment Share on other sites More sharing options...
Isolate Posted April 12, 2015 Author Share Posted April 12, 2015 Please show your code so it can be identified easier, more preferrably, a MCVE bot.getCanvas().getBounds(); only returns the rectnagle of the canvas position within the client, so it returns 0,0,width,height. So when using robot to take a screenshot it does it from the 0,0 of your screen. Quote Link to comment Share on other sites More sharing options...
fixthissite Posted April 12, 2015 Share Posted April 12, 2015 (edited) bot.getCanvas().getBounds();only returns the rectnagle of the canvas position within the client, so it returns0,0,width,height. So when using robot to take a screenshot it does it from the 0,0 of your screen. You want getLocationOnScreen(). getBounds() returns the locatiom of the component relative to it's container, not your screen Edited April 12, 2015 by fixthissite 1 Quote Link to comment Share on other sites More sharing options...
Isolate Posted April 12, 2015 Author Share Posted April 12, 2015 You want getLocationOnScreen(). getBounds() returns the locatiom of the component relative to it's container, not your screen Quote Link to comment Share on other sites More sharing options...