Java – JFrame: get the actual content size

I've created a JFrame, and trying to get its size will produce incorrect results compared to what I expected

I've made sure it includes the operating system border and title bar around the edge

How do I get / set the actual size I can use for rendering?

Solution

The size you get is the size of the content and the size of insets If you use JComponent Getinsets (), you can find the size of the content by simple subtraction

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>