我有一个JFileChooser
这样的:
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
if(fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
//do something
}
现在我想设置它的最小/最大尺寸,因为如果我减小尺寸看起来很糟糕,否则(这甚至不是可能的最小尺寸):
JFileChooser
如果用户想让它比这个更小,我不能冻结它的大小吗?:
我试过这个:fileChooser.setMinimumSize(new Dimensio(400, 400));
,但它没有用。
而且我认为它看起来不太好,如果尺寸“跳”回来,当用户使窗口更小时,例如600p * 600p
.