• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to disable JFileChooser's "create new folder "icon  RSS feed

 
Jawad Kakar
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
How to disable create new folder icon in a JFileChooser, I want to use this filechooser for opening files only.
Thank you
Jawad Kakar
[ November 23, 2002: Message edited by: Jawad Kakar ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A quick and dirty way is to create this method and pass your JFileChooser to it :



This relies on finding a button with the tool tip text "Create New Folder", so it will break if that exact tool tip text is not on the button... but that is the default tool tip text for JDK 1.4.1_01... not sure about other versions, though...
 
Jawad Kakar
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Nate.
Jawad
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!