Skip to Main Content

Java SE (Java Platform, Standard Edition)


For appeals, questions and feedback about Oracle Forums, please email Please ask technical questions in the appropriate category. Thank you!

JFileChooser setMinimunSize not working?

843805Jan 10 2007 — edited Jan 11 2007
I'm using Windows Xp service pack 2 and Java 6 build 104
maybe I'm doing something wrong, but setMinimumSize(Dimension) on JFileChooser is not working for me.

can someone help me?

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class FileChooserSizeTest {

JFrame frame;
public FileChooserSizeTest(){

frame = new JFrame("File Chooser Test");
frame.setLayout(new BorderLayout());
JButton clicMe = new JButton("click me");
clicMe.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){

JFileChooser fc = new JFileChooser();
fc.setMinimumSize(new Dimension(200,200)); // ????
fc.setDialogTitle("Save file As");

final int rVal = fc.showSaveDialog(frame);
if(rVal == JFileChooser.APPROVE_OPTION)


frame.add(clicMe, BorderLayout.CENTER);
public static void main(String[] args){

SwingUtilities.invokeLater(new Runnable(){
public void run(){

new FileChooserSizeTest();


Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2007
Added on Jan 10 2007