I want to open a directory not a file

Hi,
I have a question. I'm looking for a dialog box where the user can browse for a directory. All I can find is a dialog box where you can open a file.
Is there one to open a directory? If not, how can I solve this so the user can select a directory?
Thanks.

What was wrong with my reply in http://forum.java.sun.com/thread.jspa?threadID=754481&tstart=0 ?

Similar Messages

  • I want to open a directory only not a file

    Hai
    have a peace day.
    I have a question. I'm looking for a dialog box where the user can browse for a directory. All I can find is a dialog box where you can open a file.
    Is there one to open a directory? If not, how can I solve this so the user can select a directory?
    Thanks.

    yes man
    sorry for wrong information
    do u any sample code
    i tried but i can't get it
    this is my code
    import java.awt.*;
    import java.awt.event.*;
    import java.io.File;
    import javax.swing.*;
    public class Test extends JFrame {
    JFileChooser chooser = new JFileChooser();
    JButton button = new JButton("show file chooser ...");
    public Test() {
    super("Simple File Chooser Application");
    Container contentPane = getContentPane();
    contentPane.setLayout(new FlowLayout());
    contentPane.add(button);
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    int state = chooser.showOpenDialog(null);
    File file = chooser.getSelectedFile();
    if(file != null &&
    state == JFileChooser.DIRECTORIES_ONLY) {
    JOptionPane.showMessageDialog(
    null, file.getPath());
    else if(state == JFileChooser.CANCEL_OPTION) {
    JOptionPane.showMessageDialog(
    null, "Canceled");
    public static void main(String args[]) {
    JFrame f = new Test();
    f.setBounds(300,300,350,100);
    f.setVisible(true);
    f.setDefaultCloseOperation(
    WindowConstants.DISPOSE_ON_CLOSE);
    f.addWindowListener(new WindowAdapter() {
    public void windowClosed(WindowEvent e) {
    System.exit(0);
    }

  • [SOLVED]JDownloader: Open File / Open Download Directory not clickable

    I bought a new drive, JD downloads without problems in a folder in this drive, but I can not click on Open File and Open Download Directory.
    I use Thunar.
    On my previous installation I had the same problem and solved it by moving the download folder to /home/username (but I don't want my folder there anymore).
    Any idea why is this happening? Permissions? fstab? I don't see anything wrong...
    Thank you
    Last edited by hariskar (2014-03-31 04:56:04)

    The problem described above was with the setup file from jdownloader.org. With setup from AUR there is no such problem.

  • Shared solution - Link to a directory not a file

    Approximately six months I remember seeing in the consultant newsletter a procedure to allow you to create a user defined field and then link to a directory as opposed to a file.
    As usual, I cannot find this on the portal anywhere - does anyone have it or can anyone tell me how to do this.
    Thanks in advance
    Edited by: Susanne Klemm on May 7, 2008 1:44 PM
    Edited by: Philip Eller on May 21, 2008 9:00 AM

    Hi
    You just need to create a file with .bat extension and assign the command you want to run. In this case run the explorer and point to the folder you want. Here are the steps as a sample:
    1. Create a file test.bat
    2. Add the command followed by the folder you want to open:
    explorer C:\Install
    3. Create and UDF as
    Type: General
    Structure: Link
    I hope that helps.
    Paulo CAlado
    SAP Business One Forums Team

  • When I try to open a document in word, it wants to open it as a picture file. How do I change this setting?

    I can no longer open word documents and view or work in them. Everything wants to open as a picture file and says there is "no preview available". I just need to know how to change the settings back to what they were so I can work in downloaded microsoft documents.

    Are these Word documents email attachments that you are saving using right-click and Save Link As? It's possible that your email website has changed and instead you need to click the image or use the site's button.

  • When I double click a PS file, it opens PS but not the file. Why?

    Since I purchased CS5, I've found that double clicking, or dragging to the Ps (or Ai) icon in the dock will only open the program, but not the file. I then have to go back and double click the file again to bring it up. I've looked in preferences but cannot find a way to resolve this. A friend who also has CS5 does not have this problem.
    Thanks, Neil.

    Have you updated your OS lately?
    Are you on a Mac or a PC?
    That behavior usually is sign of a file vital for Photoshop (and some other Adpobe apps too) missing.
    I've published an old Adobe technote about that here http://www.ninisworld.com/thecorner/tutorials/photoshopopen.html including also the file needed on a Mac.
    If you are on a PC I have no solution to suggest.

  • Double clicking PS files opens Photoshop but not the file? why?

    Mac OSX 10.4.11 - Adobe Photoshop 8.0
    Since re-installing my system a few months ago double clicking on a photoshop doc will open Photoshop itself but not the file I have clicked on - can't work out why. Can anyone help? Any file wherever its saved the same thing happens.
    Thanks

    And here
    including download of the file you need to add.

  • Want to open multiple windows not tabs; won't let me.

    I have Windows XP. Since I upgraded to 7.0.1 (and today 8.0) I have not been able to open multiple windows of Firefox. I have not ticked OPEN TABS INSTEAD OF WINDOWS, but Firefox either opens nothing at all, when I try to start a 2nd window of it, or it opens a tab. Please fix this.

    Does it still happen ifyou start Firefox in Save mode?
    *Help > Restart with Add-ons Disabled
    If it does work properly in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    *Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • How do I open a directory of music files (wav) without adding to library?

    In Windows Media Player I can go to a directory and open the whole folder and play it without adding it to the library. Can this be done in iTunes?
    I record my LPs at 96K, 24bit and just want to play them back. If I add them, since the id3 tag information is not there, I cannot easily find them and cannot sort them since they are not labeled.

    Try unchecking the option to add to library when played.
    If that doesn't work then you could add the tag info.

  • Opening any email in outlook now produces a "file download" window asking if I want to open or save this html file. The file type is always a (different) Firefox document. How do I stop this?

    This happens every time an email is opened, regardless of whether there is a file attachment and regardless of whether Firefox is running.

    Deleted it, restarted it. tried it again. no change. repeated the whole cycle. no change. thinking about uninstalling and reinstalling, but that won't reallyk change the settings.

  • How do you open a directory ?

    Hello everyone !
    My situation :
    I'm working on a small application that manages all my pictures in a directory.
    My problem:
    My application should open a subdirectory, not a file. This is what I got to view a picture :
    private void openPicture(String name)
                   String location = "D:\\Pictures\\"+name+".jpg";
                   try
                        Runtime.getRuntime().exec("cmd /c \""+location+"\"");
                   } catch (IOException e)
                        JOptionPane.showMessageDialog(this,"Error while openening the file !");
                        e.printStackTrace();
              }So now I want it to open a SUBDIRECTORY(and view it in my Windows explorer) instead of opening file..... Any ideas ?
    And YES, I'm new to Java programming --> Apologies.
    Thanks

    Thanks for the quick reply !
    That JFileChooser looks interesting to use later, but I won't need it now ! =)
    As I'm just working on my Windows platform, I found this :
    private void openDirectory()
                   String location = " D:\\Films\\"+dc.getIDMovie()+"\\";
                   try
                        Runtime.getRuntime().exec("explorer.exe"+location);
                   } catch (IOException e)
                        JOptionPane.showMessageDialog(this,"Error while openening the directory !");
                        e.printStackTrace();
              }Stupid me, could've found this immediately.
    Thanks anyway for the reply and have a nice day !
    Andrew

  • Problem when open Integration Directory

    Hi :
        when I want to open Integration Directory, there is a message saying " You need to install   Javau2122 WebStart 1.4.2.   ", however I have installed j2sdk-1_4_2_12-windows-i586-p.exe which is the edition of j2sdk 1.4.2 . I am really confused.
        Could you please tell me how to solve it ?

    Hi,
    Could you please tell me which Version of SAP XI/PI you are using.
    if your are using PI 7.0 then the JDK version which you installed is correct.
    Regards,
    Ashok.

  • Ftp error: directory not found

    Am getting the following error from the Filezilla server:
    +...+
    +(000066)11/1/2010 23:39:54 PM - (not logged in) (127.0.0.1)> Connected, sending welcome message...+
    +(000066)11/1/2010 23:39:54 PM - (not logged in) (127.0.0.1)> 220-FileZilla Server version 0.9.37 beta+
    +(000066)11/1/2010 23:39:54 PM - (not logged in) (127.0.0.1)> 220-written by Tim Kosse ([email protected])+
    +(000066)11/1/2010 23:39:54 PM - (not logged in) (127.0.0.1)> 220 Please visit http://sourceforge.net/projects/filezilla/+
    +(000066)11/1/2010 23:39:54 PM - (not logged in) (127.0.0.1)> USER ftpuser+
    +(000066)11/1/2010 23:39:54 PM - (not logged in) (127.0.0.1)> 331 Password required for ftpuser+
    +(000066)11/1/2010 23:39:54 PM - (not logged in) (127.0.0.1)> PASS ******+
    +(000066)11/1/2010 23:39:54 PM - ftpuser (127.0.0.1)> 230 Logged on+
    +(000066)11/1/2010 23:39:54 PM - ftpuser (127.0.0.1)> PWD+
    +(000066)11/1/2010 23:39:54 PM - ftpuser (127.0.0.1)> 257 "/" is current directory.+
    +(000066)11/1/2010 23:39:54 PM - ftpuser (127.0.0.1)> PWD+
    +(000066)11/1/2010 23:39:54 PM - ftpuser (127.0.0.1)> 257 "/" is current directory.+
    +(000066)11/1/2010 23:39:54 PM - ftpuser (127.0.0.1)> CWD /D:\tmp+
    +(000066)11/1/2010 23:39:54 PM - ftpuser (127.0.0.1)> 550 CWD failed. "/D:/tmp": directory not found.+
    +...+
    Created a File Read adapter (opaque schema) to a mediator to a FTP file ASCII/PUT adapter (opaque schema) used a Physical directory name.
    The folder D:\tmp exists yet the error message says it does not exist.
    Using SOA 11g and JDev 11.1.1.1.0. The FTP server is Filezilla. I also installed the Filezilla client to test the server and all is well.
    The following errors are received in the WLS server:
    Invalid Output Directory.
    The value specified for the output (Physical/Logical)Directory interaction parameter or jca binding property has an invalid value "D:\tmp".
    +".+
    +The invoked JCA adapter raised a resource exception.+
    +Please examine the above error message carefully to determine a resolution.+
    +at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:427)+
    +at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeJcaReference(JCAInteractionInvoker.java:530)+
    +at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeAsyncJcaReference(JCAInteractionInvoker.java:49+
    +4)+
    +at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAEndpointInteraction.performAsynchronousInteraction(JCAEndpointInteractio+
    +n.java:463)+
    +at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:244)+
    +... 50 more+
    +Caused by: BINDING.JCA-11014+
    +Invalid Output Directory.+
    +Invalid Output Directory.+
    +The value specified for the output (Physical/Logical)Directory interaction parameter or jca binding property has an invalid value "D:\tmp".+
    +Ensure that the following conditions are satisfied for the output directory :+
    +1) It exists and is a directory (not a file). and+
    +2) It is writable (file write permissions). and+
    +3) If using a logical name, then ensure that the mapping from logical name<->physical directory is correctly specified in the deployment descriptor.+
    +at oracle.tip.adapter.ftp.FTPAgent.validateOutputDir(FTPAgent.java:1178)+
    +at oracle.tip.adapter.file.outbound.FileInteraction.validateDirectory(FileInteraction.java:2726)+
    +at oracle.tip.adapter.file.outbound.FileInteraction.executeFileWrite(FileInteraction.java:548)+
    +at oracle.tip.adapter.ftp.outbound.FTPInteraction.execute(FTPInteraction.java:238)+
    +at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:297)+
    +... 54 more+
    +Caused by: BINDING.JCA-11431+
    +Error changing directory in the host.+
    +Error changing directory in the host.+
    +Change working directory to /D:\tmp in the server failed.+
    +Please make sure that the directory exists.+
    +at oracle.tip.adapter.ftp.FTPClient.changeWorkingDirectory(FTPClient.java:1722)+
    +at oracle.tip.adapter.ftp.FTPAgent.validateOutputDir(FTPAgent.java:1173)+
    +... 58 more+
    +Nov 2, 2010 12:00:41 AM oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl log+
    +SEVERE: JCABinding=> FileR FileRAdapter Service FileR was unable to perform delivery of inbound message to the composite default/Project1!1+
    +.0*84c0aec5-77de-4c6a-b977-6bb1ba63dee9 due to: BINDING.JCA-12563+
    +Exception occured when binding was invoked.+
    +Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'Put' failed due to: Invalid Output Director+
    y.
    Invalid Output Directory.
    The value specified for the output (Physical/Logical)Directory interaction parameter or jca binding property has an invalid value "D:\tmp".
    +".+
    +The invoked JCA adapter raised a resource exception.+
    +Please examine the above error message carefully to determine a resolution.+
    *Thanks Casey*
    Edited by: casey on Nov 1, 2010 10:08 PM

    You were correct - the previous error was a Filezilla config issue. That has been corrected and I can, using the Filezilla client get into and browse d:\tmp - no problems.
    Now have another problem that I thought was fixed yesterday - server does not recoginize server username/password - see below and comments below the error message. The username/password is the same as used by the client to connect to the server
    +…+
    +... 10 more+
    Caused by: BINDING.JCA-12563
    Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'Put' failed due to: Error in logging in.
    Error in logging in.
    Unable to log in to the server.
    +".+
    +The invoked JCA adapter raised a resource exception.+
    +Please examine the above error message carefully to determine a resolution.+
    +at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:427)+
    +at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeJcaReference(JCAInteractionInvoker.java:530)+
    +at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeAsyncJcaReference(JCAInteractionInvoker.java:49+
    +4)+
    +at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAEndpointInteraction.performAsynchronousInteraction(JCAEndpointInteractio+
    +n.java:463)+
    +at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:244)+
    +... 52 more+
    +Caused by: BINDING.JCA-11439+
    +Error in logging in.+
    +Error in logging in.+
    +Unable to log in to the server.+
    +Please ensure userid and password specified to login to the server is correct.+
    +at oracle.tip.adapter.ftp.FTPClient.regularLogin(FTPClient.java:1614)+
    +at oracle.tip.adapter.ftp.FTPClient.login(FTPClient.java:1561)+
    +at oracle.tip.adapter.ftp.FTPAgent.login(FTPAgent.java:1094)+
    +at oracle.tip.adapter.ftp.FTPAgent.preCall(FTPAgent.java:1515)+
    +at oracle.tip.adapter.ftp.FTPAgent.validateOutputDir(FTPAgent.java:1154)+
    +at oracle.tip.adapter.file.outbound.FileInteraction.validateDirectory(FileInteraction.java:2726)+
    +at oracle.tip.adapter.file.outbound.FileInteraction.executeFileWrite(FileInteraction.java:548)+
    +at oracle.tip.adapter.ftp.outbound.FTPInteraction.execute(FTPInteraction.java:238)+
    +at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:297)+
    +... 56 more+
    *The EIS Username/password was configured as per the following:*
    +Outbound Connection Pool: eis/Ftp/FtpAdapter+
    +EIS Type: FTP+
    +WebLogic Server User: weblogic+
    +EIS User Name: ftpuser+
    +EIS User Password: oracle+
    +Confirm Password: oracle+
    *The composite has a file read wired to a mediator which is wired to a FTP ASCII/Put adapter. The file is read - leastwise it disappears from its specified Physical Directory (d:\temp) - but is not 'Putted' to the d:\tmp folder.*
    *Error message from mediator*
    onMessage
    Nov 2, 2010 8:53:13 AMonCase "FTPPut.Put"
    Nov 2, 2010 8:53:13 AMTransformed message part "opaque" using xsl/opaqueElement_To_opaqueElement.xsl"
    Nov 2, 2010 8:53:14 AMError during invoking 1-way operation "Put" on target service "FTPPut"
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'Put' failed due to: Error in logging in. Error in logging in. Unable to log in to the server. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    The Filezilla output is:
    +(000009)11/2/2010 9:36:59 AM - (not logged in) (127.0.0.1)> Connected, sending welcome message...+
    +(000009)11/2/2010 9:36:59 AM - (not logged in) (127.0.0.1)> 220-FileZilla Server version 0.9.37 beta+
    +(000009)11/2/2010 9:36:59 AM - (not logged in) (127.0.0.1)> 220-written by Tim Kosse ([email protected])+
    +(000009)11/2/2010 9:36:59 AM - (not logged in) (127.0.0.1)> 220 Please visit http://sourceforge.net/projects/filezilla/+
    +(000009)11/2/2010 9:36:59 AM - (not logged in) (127.0.0.1)> USER+
    +(000009)11/2/2010 9:36:59 AM - (not logged in) (127.0.0.1)> 501 Syntax error+
    +(000009)11/2/2010 9:37:38 AM - (not logged in) (127.0.0.1)> disconnected.+

  • Replace a 2003 (not R2) File Server with a 2012R2 files server and preferably keep the same machine name and IP when finished

    I am wanting to replace a 2003 (not R2) File Server with a 2012R2 file server and preferably keep the same machine name and IP when finished.  For the moment I just need some "high level" guidance, little details can be worked out once I know
    which direction I will go.  I was considering that DFS might be a way to help get through the process although when finished the 2012R2 Files server will be by itself with no other file server planned at this time.  DFS can stay installed for maybe
    future purposes but clearly I wouldn't need the DFS Replication with only one machine.
    Here's a few details of the environment....
    1.  DC's are 2012R2 but it is still 2003 DFL because the old 2003 DCs are still present.  But likely they will be gone and the DFL elevated before I start on the File Server project
    2. Nearly all machines in the facility have a shortcut on the "All Users" Desktop that points to the existing old File Server.  Editing or replacing that shortcut would be a major pain,...hence why I want to keep the same machine name at least,
    and maybe the same IP if not too much trouble.  This way the existing shortcut would continue to work with the new 2012R2 File Server.  The UNC path represented in that shortcut is also configured into one or more of our major business applications,
    futher emphasizing the need to keep the UNC path the same throughout the process.
    3. The facility runs 24/7/365 but is "light" on weekends.  The political environment is such that there is little to no tolerance for any down time at all.
    4. Would DFS (based from the 2012R2 machine) be a good tool to get where I need to go?
    Thanks for any suggestions.
    Phillip Windell

    Hi Sharon,
    I've done some more reading and have a few new ideas to run past you....
    Yes regular DFS wouldn't help and the Namespace would still be different than how it was with just the old server. However I was thinking DFS Replication could replace the purpose of RoboCopy and it would keep the two locations "in sync" until I was ready
    to flip over to the new server.  DFS Rep can exist independently of a DFS Namespace, so a Namespace is not even needed. It needs a minimum of 2003R2 for the "later & better" DFS Rep but I believe 2003 can do an "in place" upgrade to 2003R2, so I would upgrade
    the old server to 2003R2 first.  As long as the DFS Rep on 2012R2 and 2003R2 will properly interact I think that will work.
    Thanks for the reg info on the Shares.  I'm debating if editing that would reg file would really be much better than manually creating the Shares on the new server while the DFS Replication was doing its job.  I'll probably export that Key as a
    safety move whether I use it or not.
    Once the DFS Rep is fully in sync and the Shares are in place on the new server, I figure I would then:
    1. Remove the DFS Replication Object (optionally remove DFS Services completely)
    2. Rename the old File Server to something else and set it to DHCP
    3. Rename the new File Server to the name I want to use and give it the IP the old server had.
    How does that sound?
    Phillip Windell

  • Prompted to Open or Save a pdf File. Very Annoying!!

    I have Windows 7, IE9, and Adobe Reader X. My question is this. When I click on a pdf file to open it, I receive a bar across the bottom of my window asking me if I want to open or save the pdf file. How can I just get the pdf to open and stop the prompt from appearing?

    If you use the 32-bit version of IE9 there should be no prompt; it sould open inside the browser.

Maybe you are looking for

  • Composite vs Component

    I am debating on buying either the Composite or Component AV cable for my iPhone to play movies on friends TVs. I want to buy the one that is gonna work on the bulk of TVs out there. The trend seems like most even new TVs will have RCA inputs but I k

  • Overhead Cost Element not update

    Hi, I have created Cost sheet , assigned to Production plant, for FG Material, Overhear updated when run SCE, and production order also updated but after settlement secondary GL a/c with Credit cost center not update. in system show no value in parti

  • Photoshop Elements V6

    Hola, soy usuario de Mac, y acaba de salir Photoshop Elements V6 para Mac, y sigue en ingles, para cuando Adobe sacará los programas en español, es insoportable. Menos mal que hay programas alternativos y ademas gratuitos, como por ejemplo El Gimp qu

  • Two Path Bars!

    Hello folks, A while ago I chose to include a Path bar in CS4 Bridge. How I included it I don't remember. It is NOT the selection Window>Path Bar. It is a bar within the Content Tab that shows a white path bar with a Go button and a New Window button

  • Portege M600 - Sound issue - No audio outout device

    I kinda have this exact problem with my Toshiba M600 too, it was fine till now, the sound sometimes available, sometimes "No audio output device". I initially thought it was a driver issue that I didn't manage to solve earlier. So I thought of moving