Solved

Improving on the JFileChooser

Posted on 2000-03-01
2
213 Views
Last Modified: 2008-03-10
How do I get a JFileChooser dialog to display the "Network Neighborhood", "My Briefcase", or "Desktop" in the Directory Dropdown?
0
Comment
Question by:lgrove
2 Comments
 
LVL 5

Expert Comment

by:Jan Louwerens
Comment Utility
Network Neighborhod, My Briefcase, and Desktop are all platform specific, so even if there is a possible solution, you would still limit your user base to user of that platform.
0
 
LVL 6

Accepted Solution

by:
jpk041897 earned 200 total points
Comment Utility
To address the specific question though,

the Desktop and My Briefcase are both directories so you could subclass  JFileChooser to display these folders as well as the root.

As far as network Neighberhood though, its based on NETBEUI, not TCP/IP so you would have to use JNI to set up a native access.

So, as far as a solution goes, you have two options:

1.- Subclass  JFileChooser to add the functionality that you want and write native methosds to access the net.

2.- Use the Beans/ActiveX bridge and use an ActiveX controll to do it for you.


Which method to use realy depends on your specific needs but in general option 2 represents considerably less work. Although it will compliacte deploying as an applet.


Now as jlouwere states, either solution would not be portable to other plattforms and additionaly could represent severe security risks if deployed outside an intranet.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now