• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFileChooser CUSTOM_DIALOG issue

 
Muth Rama
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using JFileChooser CUSTOM_DIALOG one. Here is the snippet of the code :

fileChoose = new JFileChooser();
fileChoose.setDialogType(JFileChooser.CUSTOM_DIALOG);
fileChoose.setMultiSelectionEnabled(false);
fileChoose.setFileSelectionMode(JFileChooser.FILES_ONLY);
fileChoose.setControlButtonsAreShown(false);
fileChoose.addPropertyChangeListener(this);

Here I have disabled the default buttons. I am using my customized one. When I select the file in the FileChooser I am able to retrieve the filename by using the below method as expected.

fileChoose.getSelectedFile();

But, the typed filename in the "File Name" textfield of the FileChooser is not getting reflected in the fileChoose.getSelectedFile() method.It is always providing the previously selected filename not the typed one in the text field. Please share your thoughts.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!