Instead of the whole window complete with close, maxi- and minimize buttons, as well as border?
I'm trying to save a screenshot of the client area...maximizedBounds crashes the app...
Instead of the whole window complete with close, maxi- and minimize buttons, as well as border?
I'm trying to save a screenshot of the client area...maximizedBounds crashes the app...
Get the bounds of the content pane instead (i.e. JFrame.getContentPane().getBounds()
).
This did the trick:
Point pos = this.getContentPane().getLocationOnScreen();
Rectangle clientRect = this.getContentPane().getBounds();
clientRect.x = pos.x;
clientRect.y = pos.y;
© 2022 - 2024 — McMap. All rights reserved.