或者你直接用JFileChooser的 int showDialog(Component parent, String approveButtonText) 弹出具有自定义 approve 按钮的自定义文件选择器对话框。 int showOpenDialog(Component parent) 弹出一个 "Open File" 文件选择器对话框。 int showSaveDialog(Component parent) 弹出一个 "Save File" 文件选择器对话框。 这些方法好了阿!都是现成的,绝对满意的大小!
应该是setSize方法可以,你再检查一下使用setSize public void setSize(int width, int height) Resizes this component so that it has width width and height height. Parameters: width - the new width of this component in pixels height - the new height of this component in pixels
int showDialog(Component parent, String approveButtonText)
弹出具有自定义 approve 按钮的自定义文件选择器对话框。
int showOpenDialog(Component parent)
弹出一个 "Open File" 文件选择器对话框。
int showSaveDialog(Component parent)
弹出一个 "Save File" 文件选择器对话框。
这些方法好了阿!都是现成的,绝对满意的大小!
public void setSize(int width,
int height)
Resizes this component so that it has width width and height height. Parameters:
width - the new width of this component in pixels
height - the new height of this component in pixels