Guest_imported
New member
- Jan 1, 1970
- 0
Hi,
I created a menu to open a JFileChooser. This is working fine. I created a new filter (only *.jpg-files) and this is also working. If I close the JFileChooser dialog and I open it a second time, everythin is working BUT ... in the "Files of type" there is two time my description!! If I open it a third time there is three times my description ...
How can I solve this problem?
Thanks!!
Here is the coding of the setFileFilter
setFileFilter(new javax.swing.filechooser.FileFilter() {
public boolean accept(java.io.File bestand) {
beginIndex = 0;
if (bestand.isDirectory()) return true;
if (bestand.getName().endsWith(".jpg") return true;
return false;
}
public String getDescription() {
return alleExtensies;
}
});
I created a menu to open a JFileChooser. This is working fine. I created a new filter (only *.jpg-files) and this is also working. If I close the JFileChooser dialog and I open it a second time, everythin is working BUT ... in the "Files of type" there is two time my description!! If I open it a third time there is three times my description ...
How can I solve this problem?
Thanks!!
Here is the coding of the setFileFilter
setFileFilter(new javax.swing.filechooser.FileFilter() {
public boolean accept(java.io.File bestand) {
beginIndex = 0;
if (bestand.isDirectory()) return true;
if (bestand.getName().endsWith(".jpg") return true;
return false;
}
public String getDescription() {
return alleExtensies;
}
});