你为什么不看API doc呢?getInsets public Insets getInsets() Determines the insets of this container, which indicate the size of the container's border. A Frame object, for example, has a top inset that corresponds to the height of the frame's title bar. 改变insets的方法很多,setMargin是其中一种,setBorder也是Insets其实就是Windows里面的non-client area,我想。例如,JScrollPane的滚动条,应该也是Insets之内的东西。
Container类有getInsets()函数,却没有setInsets()啊!
public Insets getInsets()
Determines the insets of this container, which indicate the size of the container's border.
A Frame object, for example, has a top inset that corresponds to the height of the frame's title bar. 改变insets的方法很多,setMargin是其中一种,setBorder也是Insets其实就是Windows里面的non-client area,我想。例如,JScrollPane的滚动条,应该也是Insets之内的东西。