Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem in using FilenameFilter with FileDialog

843806Dec 27 2007 — edited Dec 27 2007
perhaps, i dont know how to use FilenameFilter with FileDialog because the following approach doesn' work
FileDialog fd=new FileDialog(myframe,"Select an image");
 fd.setFilenameFilter(new filefilter());                                                                                                                            
                                                                                                         class filefilter implements FilenameFilter{
    public boolean accept(File dir, String name) {
        if(name.endsWith("jpg")||name.endsWith("gif")||name.endsWith("png")){
                      return true;  
             }
             return false;
    }
    
}
if anyone have compatible idea then please let me know.

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 24 2008
Added on Dec 27 2007
1 comment
144 views