Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileFilter()

Status
Not open for further replies.

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;
}
});
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top