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 / GUI / January 2004

Tip: Looking for answers? Try searching our database.

JFileChooser "create directory"

Thread view: 
Steven Buroff - 24 Jan 2004 15:04 GMT
I want to remove the "create directory" button from a JFileChooser that
I'm using as part of a larger panel, not using its "open dialog" methods.
I tried doing:
           UIManager.put("FileChooser.readOnly", new Boolean(true));
but the result was:
       java.lang.NullPointerException
       at sun.swing.FilePane.addActionsToMap(FilePane.java:346)
       at sun.swing.FilePane.createActionMap(FilePane.java:338)
       at sun.swing.FilePane.<init>(FilePane.java:124)
       at javax.swing.plaf.metal.MetalFileChooserUI.installComponents
(MetalFileChooserUI.java:185)
       at
javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:
135)
       at
javax.swing.plaf.metal.MetalFileChooserUI.installUI(MetalFileChooserUI.java:
123)
       at javax.swing.JComponent.setUI(JComponent.java:624)
As a second-best alternative I'd settle for disabling the button. I tried:

((BasicFileChooserUI)fileChooser.getUI()).getNewFolderAction().setEnabled(fa
lse);
but the button was still enabled.
Any idea how to remove the button or at least to disable it? Please reply by
email to
sburoff@optonline.net if possible. Thanks very much.

Steve Buroff
hiwa - 25 Jan 2004 00:26 GMT
> I want to remove the "create directory" button from a JFileChooser that
> I'm using as part of a larger panel, not using its "open dialog" methods.
[quoted text clipped - 24 lines]
>
> Steve Buroff

setFileSystemView(new MyRestrictiveFileSystemView());


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.