例如,如果我使用方法setPreferedSize(new Dimension(0,160,10,10))设置面板的大小,但是我添加了许多其他组件(例如,一系列大按钮),而面板的大小超过160px:我如何找到面板的实际高度?
发布于 2011-04-26 17:49:44
使用JComponent#getHeight()。来自其JavaDoc:Returns the current height of this component.
https://stackoverflow.com/questions/5788577
复制相似问题