Java – JFrame: get the actual content size
•
Java
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
二维码