Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can JFileChooser disable the File Name field  RSS feed

 
Joe Vahabzadeh
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

I have a feeling I'm missing something very obvious, but I have a scenario where I want the user to select an existing file to open - however, I do NOT want them to type in an arbitrary and possibly non-existent filename in the File Name field... I only want them to be able to select an existing file.

Is there any way I can get JFileChooser to disable the "File Name" field? Or is the only solution to simply check for the existence of the file after the user has selected/typed-in a name?

Thanks in advance.
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way I can get JFileChooser to disable the "File Name" field?
One way way to do this is to write some plaf code.
Another is to find the component and hide or disable it.
Or is the only solution to simply check for the existence of the file after the user has
selected/typed-in a name?

This is the easiest approach.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!