Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > simple help abo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 16024 of 16078
Post > Topic >>

simple help about JFileChooser

by dreamtackler@[EMAIL PROTECTED] Apr 26, 2008 at 04:24 AM

here is a method i writte in java
public void aaa(){
        JFileChooser chooser=new JFileChooser();
           chooser.setFileFilter(new FileFilter() {//
setFileFilter(javax.swing.Filechooser.filefilter)
//in javax.swing.JFileChooser can't applied to (<anonymous
java.io.fileFilter>)
            public boolean accept(File f) {
                String fileName = f.getName().toLowerCase();
                return fileName.endsWith(".txt") || f.isDirectory();
            }
            public String getDescription() {
                return "Text Files";
            }
        });
        chooser.showOpenDialog(this);
    }

when used in some class it run well.but when it appear in some
class,it goes wrong .the IDE tell me that
setFileFilter(javax.swing.Filechooser.filefilter)
//in javax.swing.JFileChooser can't applied to (<anonymous
java.io.fileFilter>).
who can tell me what's that means. and why that happen




 3 Posts in Topic:
simple help about JFileChooser
dreamtackler@[EMAIL PROTE  2008-04-26 04:24:57 
Re: simple help about JFileChooser
Hendrik Maryns <gtw37b  2008-04-26 13:47:21 
Re: simple help about JFileChooser
Roedy Green <see_websi  2008-04-26 13:07:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 0:08:23 CDT 2008.