?
Solved

Improving on the JFileChooser

Posted on 2000-03-01
2
Medium Priority
?
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Expert Comment

by:Jan Louwerens
ID: 2574799
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 600 total points
ID: 2575177
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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Suggested Courses
Course of the Month8 days, 2 hours left to enroll

765 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