Improving on the JFileChooser

How do I get a JFileChooser dialog to display the "Network Neighborhood", "My Briefcase", or "Desktop" in the Directory Dropdown?
lgroveAsked:
Who is Participating?
 
jpk041897Connect With a Mentor Commented:
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
 
Jan LouwerensSoftware EngineerCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.