开发者

Is there a JFrame.getBounds equivalent that gets only the actual client area?

Instead of the whole window c开发者_如何学Goomplete 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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜