JFrame:获得无边界的大小? [英] 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:获得无边界的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文