JFrame: get size without borders?(JFrame:获得无边界的大小?)
问题描述
在Java中,是否可以在没有标题和其他边框的情况下获取JFrame的Width和Height?
In Java, is it possible to get the Width and Height of the JFrame without the title and other borders?
frame.getWidth() 和 frame.getHeight()1 似乎返回了包括边框在内的宽度.
frame.getWidth() and frame.getHeight()1 seems to return the width including the border.
谢谢.
推荐答案
frame.getContentPane().getSize();
这篇关于JFrame:获得无边界的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!