Java GUI中的JFileChooser怎么设置选择框的宽度和高度

如题所述

JFileChooser j = new JFileChooser("F:\\Program Design\\JAVA program") ;
这里的参数用String就没有问题。
温馨提示:内容为网友见解,仅供参考
第1个回答  2017-10-25
Methods inherited from class java.awt.Component
public void setSize(Dimension d)

Resizes this component so that it has width d.width
and height d.height.
This method changes layout-related information, and therefore,
invalidates the component hierarchy.

Parameters:
d - the dimension specifying the new size
of this component

public void setSize(int width, int height)

Resizes this component so that it has width width
and height height.
This method changes layout-related information, and therefore,
invalidates the component hierarchy.

Parameters:
width - the new width of this component in pixels
height - the new height of this component in pixels
相似回答