• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
k kju
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.
 
Paweł Baczyński
Bartender
Posts: 2054
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!