Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2008

Tip: Looking for answers? Try searching our database.

simple help about JFileChooser

Thread view: 
dreamtackler@gmail.com - 26 Apr 2008 12:24 GMT
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
Hendrik Maryns - 26 Apr 2008 12:47 GMT
dreamtackler@gmail.com schreef:
| here is a method i writte in java

<snip>

Please don’t multipost.  I replied in c.l.j.p.

H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Roedy Green - 26 Apr 2008 14:07 GMT
>here is a method i writte in java
>public void aaa(){
[quoted text clipped - 20 lines]
>java.io.fileFilter>).
>who can tell me what's that means. and why that happen

see http://mindprod.com/jgloss/jfilechooser.html

There are two flavours of FileFilter.  You need a slightly more
elaborate one for JFileChooser.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.