• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

how to use 'FilenameFilter' associate with FileDialog of the gui?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did a quick google search when I found it didn't work,but I haven't found a solution to solve my issue.here is part but main of the code,


why it didn't work? i use this in window.thanks for advance.
 
Bartender
Posts: 2219
47
IntelliJ IDE Firefox Browser Spring Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by doesn't work?
It Doesnt Work Is Useless

Javadoc for FileDialog#setFilenameFilter says:

Sets the filename filter for this file dialog window to the specified filter. Filename filters do not function in Sun's reference implementation for Microsoft Windows.



Are you using Windows?
Why not use javax.swing.JFileChooser?
 
k kju
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pawel Pawlowicz wrote:What do you mean by doesn't work?
It Doesnt Work Is Useless

Javadoc for FileDialog#setFilenameFilter says:

Sets the filename filter for this file dialog window to the specified filter. Filename filters do not function in Sun's reference implementation for Microsoft Windows.



Are you using Windows?
Why not use javax.swing.JFileChooser?



first of all, thanks for your response.

'doesn't work' means that, the the program works as the original way,that is,whether I add the above code or not,it 'filter' that i specified just did not appear,always perform ".*'.
in many situations,you know that, I just want to open '*.txt" type file.
 
k kju
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

k kju wrote:

Pawel Pawlowicz wrote:What do you mean by doesn't work?
It Doesnt Work Is Useless

Javadoc for FileDialog#setFilenameFilter says:

Sets the filename filter for this file dialog window to the specified filter. Filename filters do not function in Sun's reference implementation for Microsoft Windows.



Are you using Windows?
Why not use javax.swing.JFileChooser?



first of all, thanks for your response.

'doesn't work' means that, the the program works as the original way,that is,whether I add the above code or not,it 'filter' that i specified just did not appear,always perform ".*'.
in many situations,you know that, I just want to open '*.txt" type file.



yes, i'm a window user now.
ah~~ i'll have a try...thanks for your advices.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!