File directory chooser

this code for file directory chooser runs in standalone java programs. i need it for a web app, can someone help me manipulate this to do so?
package ETPS.web.service;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;
public class DemoJFileChooser extends JPanel
   implements ActionListener {
   JButton go;
   JFileChooser chooser;
   String choosertitle;
  public DemoJFileChooser() {
    go = new JButton("Do it");
    go.addActionListener(this);
    add(go);
  public void actionPerformed(ActionEvent e) {
    int result;
    chooser = new JFileChooser();
    chooser.setCurrentDirectory(new java.io.File("."));
    chooser.setDialogTitle(choosertitle);
    chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    // disable the "All files" option.
    chooser.setAcceptAllFileFilterUsed(false);
    if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
      System.out.println("getCurrentDirectory(): "
         +  chooser.getCurrentDirectory());
      System.out.println("getSelectedFile() : "
         +  chooser.getSelectedFile());
    else {
      System.out.println("No Selection ");
  public Dimension getPreferredSize(){
    return new Dimension(200, 200);
  public static void main(String s[]) {
    JFrame frame = new JFrame("");
    DemoJFileChooser panel = new DemoJFileChooser();
    frame.addWindowListener(
      new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
          System.exit(0);
    frame.getContentPane().add(panel,"Center");
    frame.setSize(panel.getPreferredSize());
    frame.setVisible(true);
}

AndrewThompson64 wrote:
BIJ001 wrote:
If we are talking about a web application, then the browser will use its file chooser when down- or uploading a file.++++
The only way to shoe-horn that code into a web page is via an applet. The applet would need to be either
a) Trusted, or..
b) Deployed in a plug-in2 JRE and use the JNLP API services to get access to an InputStream.
Either way, applets are a PITA for both the developer and (usually) the user. Stick to pure HTML in web-apps, wherever possible.
Edited by: AndrewThompson64 on May 31, 2010 9:51 PMI've also seen some attempts with Google Gears. Even file drag & drop support. It works quite neat, if the user doesn't have gears installed you get a nice requester for it. Don't know what the system requirements are for that product though.

Similar Messages

  • Hi...  I just attempted to update CC.  Download itself appears to have happened, but when then I got this message...  Installer was unable to access a critical file/directory. Please try installing again.(Error code: 43) Contact Customer Support .... can

    Installer was unable to access a critical file/directory. Please try installing again.(Error code: 43) Contact Customer Support
    Any ideas?

    Hi  Serpent,
    Try the following Steps:
    open activity monitor and close all Adobe related applications
    navigate to: /Library/Application support/Adobe
    In that directory you will see a folder named OOBE - Rename that folder to OOBEold
    Navigate to: MAC HD /Application/Utilities directory
    In there you will see a folder called "Adobe Application Manager" - delete it
    Download the Adobe Cleaner Tool from here: http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems/_jcr_conte nt/main-pars/accordion_container_1/accordion-par/accordion-item-1/accordion-item-par/proc e dure/proc_par/step_3/step_par/download/file.res/AdobeCreativeCloudCleanerTool.zip
    Open the Cleaner Tool and choose to clean "Creative Cloud" only.
    Download and install Creative Cloud again - https://ccmdls.adobe.com/AdobeProducts/KCCC/1/osx10/CreativeCloudInstaller.dmg
    Regards,
    Rave

  • How can I create a directory chooser?

    hi there
    is there any way to create a directory chooser? because it is the directory that I am more interested in, but with JFileChooser, I must select a file to get a directory. help please, and thank you.

    Just a followup regarding directory choosers.
    I previously attempted to use the JFileChooser.DIRECTORIES_ONLY selection to make a directory chooser, but found that this didn't allow the user to descend into the wanted directory, then select it.
    The following code shows my attempt to resolve this. BTW, this works because the assumption has been made that when a directory is descended into, its name will appear in the file name field.
    JFileChooser browser = new JFileChooser(System.getProperty("user.dir"));
                   browser.removeChoosableFileFilter(browser.getAcceptAllFileFilter());
                   browser.addChoosableFileFilter(new DirectoriesOnlyFilter());
                   //This method will set the dialog type to custom via setDialogType(CUSTOM_DIALOG);
                   if (browser.showDialog(this, "Select") != JFileChooser.APPROVE_OPTION)
                        return;
                   File location = browser.getSelectedFile();
                   if (!location.exists())
                        String dirName = location.getName();
                        //Find the requested directory by looking at the parent directory
                        location = location.getParentFile();
                        if (location.exists() && location.getName().equals(dirName))
                             //User has descended into the wanted directory -
                        else
                             //Cannot resolve the requested directory
                   else if (location.isDirectory())
                        //The user has clicked, without descending, onto a directory in the chooser
                        //This is the directory that the user wants
                   else
                        //Oops - File found.  This should only happen in one of two cases:
                        //1) If there is a file with the same name as the directory it is in
                        //2) If the user has typed in a file name into the field
    class DirectoriesOnlyFilter extends javax.swing.filechooser.FileFilter
         public DirectoriesOnlyFilter()
         public boolean accept(File file)
              return file.isDirectory();
         public String getDescription()
              return "Directories";
    }Hope this helps.
    Rob

  • Directory Chooser existance?

    Hi all,
    I wonder if there exisist Directory chooser component (Windows like, dislpaying only directory tree).
    I use know this code for getting similar effect but I am curious if I can do it in a better way. Thanks in advance.
    Nenko Ivanov
    JFileChooser jf = new JFileChooser();
        jf.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        if(jf.showOpenDialog(this)== JFileChooser.APPROVE_OPTION){
          File file = jf.getSelectedFile();
          if(file != null && file.isDirectory()){
            // do some stuff here
        }

    The bug report for rfe 4322989 has been updated with an example directory
    chooser class. Try it out!
    http://developer.java.sun.com/developer/bugParade/bugs/4322989.html
    Cheers,
    Leif Samuelsson
    Java Swing Team
    Sun Microsystems, Inc.

  • How do I find my CC Files Directory?

    Hello!
    Very new to the Creative Cloud.
    Trying to figure out the most basic thing--where can I find the Creative Cloud Files Directory? I want to be able to automatically backup my Photoshop and Indesign files, just in case my computer crashes.
    This site: Creative Cloud Help | Manage and Sync files --tells me if I save my files in this magical folder, they will automatically sync to the Cloud.
    Where is this folder? I'm using a Mac. I searched for it in Finder with no luck.
    Do I have to download another app?
    Help!
    Thanks,
    Super Newbie.

    doertel wrote:
    How do I put my cc files into bridge or camera raw?
    Please can you rephrase the question?

  • Error in setting permissions on file/directory $ORACLE_BASE/jre/1.1.8/LICEN

    Hi,
    On installing Oracle 9.2 on RedHat Linux release 4, I encounterd the
    following error:
    Error in setting permissions on file/directory
    $ORACLE_BASE/jre/1.1.8/LICENSE
    This error is encountered at the inital stage of installation after inputing all the
    required settings in the OUI. and at the Installing Java Runtinme Environment 1.1.8.1.0
    Could someone tell me why it happened and how to fix it? Your help is
    much appreciated.
    There was a post on this topic only in here and said to change the permissions of the
    ORACLE_BASE .......... I have tried out all these and all the permissions and the environment settings are correct but i'm not able to proceed with the installation even after a lot of trying.
    All you guys help is verry verry appreciated..........
    Thanks,

    Do the following and post the results:
    cd $ORACLE_BASE
    pwd
    ls -al
    cd jre
    pwd
    ls -al
    cd 1.18
    pwd
    ls -alI can't imagine anyone making recommendations without seeing what you've done.

  • Error in setting permissions of file/directory

    This is the error I am getting
    Error in setting permissions of file/directory /u01/app/oracle/jre/1.1.8/bin/i686/native_threads/.extract_args
    I am running RedHat 9 and obviously installing 9.2.0.
    Any ideas on why I might be getting this. I have set permissions for the oracle user for this directory.
    Thanks
    Dave

    from root try this command
    umask
    umask must set at 0022 ... if your server not set at this number use this command
    umask 0022

  • Error in setting permissions of file/directory /home/oracle/jre/1.1.8/LICENSE !

    Error in setting permissions of file/directory /home/oracle/jre/1.1.8/LICENSE ! Installation problem of 9i databse on redhat 7.3!!I installed sun jdk 1.3 or jdk 1.1.8_v3 and created a link for /usr/local/java !

    from root try this command
    umask
    umask must set at 0022 ... if your server not set at this number use this command
    umask 0022

  • Get the file directory/location using JFileChooser

    Dear,
    How to get the file directory and it location with using JFilechooser after select the indicate file?
    Thanks

    There is an example at the top of JFileChooser's doc.
    http://java.sun.com/j2se/1.4.1/docs/api/javax/swing/JFileChooser.html

  • No remittance advice output in the 'Outbound Payment File Directory'

    We are working on an upgrade from 11i to R12.
    Configuration has created a profile for an electronic payment with a separate remittance advice. They have specified an outbound payment file directory. The EFT text file is generated in the proper directory (on the appserver); however, the remittance advice file went to the default directory on the dbase server. We want to pick up the file, rename and ftp to our printer from the 'outbound payment file directory'.
    Is this expected functionality or did we miss something in configuration?

    Manu,
    I do not think it is possible -- You may log a SR and confirm this with Oracle support.
    Where Can Be Found The Output File For The Transfer To The Bank [ID 730548.1]
    How To Change Nacha Payament Output Directory And Name [ID 786007.1]
    Thanks,
    Hussein

  • File Adapetr: File is not picking from File directory

    Hello,
    Issue: we are facing issue with file sender adapter like file is not picking from source file directory.
    Scenario: FTP1>PI>FTP2
    1. SAP PI sender communication channel will pick the file from FTP1 and process to PI file server (NFS)
    2. from PI file server (NFS), file will process again to FTP2
    So while picking the file, it shows following error:
    Could not process due to error: java.lang.IllegalStateException: Error during RETR epilogue: com.sap.aii.adapter.file.ftp.FTPEx: 451 Transfer aborted. Broken pipe
    Conversion of file content to XML failed at position 0: sun.io.MalformedInputException
    Processing started
    this issue occur after we migrate the PI server from hpunix to aixunix.
    Best Regards,SARAN

    Hi,
    check the FCC parameters, fieldfixedlength option would be used when the exact length of field is constant in the Sender, In the FCC the fieldfixedlength parameter carries the length of the each.
    Check out Michal's blog on content conversion for all your doubts :The specified item was not found.
    Kindly check the below links for further assistance.
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm
    regards,
    ganesh.

  • Dynamic outbound payment file directory for  in Payment Profile in R12?

    Hi All,
    Is it possible to have the "outbound payment file directory" setup in R12 Payment Process Profile dynamically?
    Ideally we would like to store the value in a profile and refer the lookup in this field, rather than giving it hard coded, like /net/common/CM_UTL_DIR/EBSTST
    Please let us know of workarounds also, if any.
    Thanks!
    Manu

    Manu,
    I do not think it is possible -- You may log a SR and confirm this with Oracle support.
    Where Can Be Found The Output File For The Transfer To The Bank [ID 730548.1]
    How To Change Nacha Payament Output Directory And Name [ID 786007.1]
    Thanks,
    Hussein

  • Remote content crawler on a file directory in a different subnet

    I'm trying to crawl a file directory that is on our company network but in a different subnet. It seems to be set up correctly, because I have managed to import most of the documents to the knowledge directory. However, when running the job a few times, sometimes it succeeds and sometimes it fails, without consistency. The main thing I notice is that it doesn't import the larger files (>5 MB), but our maximum allowed is 100 MB. Even when the job runs "successfully" there is a message in the job log:
    Feb 21, 2006 12:08:14 PM- com.plumtree.openfoundation.util.XPNullPointerException: Error in function PTDataSource.ImportDocumentEx (vDocumentLocationBagAsXML == <?xml version="1.0" encoding="ucs-2"?><PTBAG V="1.1" xml:space="preserve"><S N="PTC_DOC_ID">s2dC33967209AEE4710C5ED073C04B3EDCF_1.pdf</S><I N="PTC_DTM_SECT">1000</I><I N="PTC_PBAGFORMAT">2000</I><S N="PTC_UNIQUE">\\10.105.1.33\digitaldocs\s2dC33967209AEE4710C5ED073C04B3EDCF_1.pdf</S><S N="PTC_CDLANG"></S><S N="PTC_FOLDER_NAME">s2dC33967209AEE4710C5ED073C04B3EDCF_1.pdf</S></PTBAG>, pDocumentType == com.plumtree.server.impl.directory.PTDocumentType@285d14, pCard == com.plumtree.server.impl.directory.PTCard@1f6ef01, bSummarize == false, pProvider == [email protected]4)ImportDocumentExfailed for document "s2dC33967209AEE4710C5ED073C04B3EDCF_1.pdf"
    When the job fails, there is a different message:
    *** Job Operation #1 failed: Crawl has timed out (exception java.lang.Exception: Too many empty batches.)(282610)
    I tried increasing the time out periods for the crawler web service and the crawler job. That didn't seem to work. Any suggestions?

    Hi Dave,
    Did you fix this issue? I'm having the same error.
    Thanks!

  • Pass export file/directory name in Web Engine plug-in

    I use a custom Lightroom web engine plug-in that I use to publish my website (5000+ pages).  Here is an example of an output section:
    http://www.johnkane.com/2010-03-01-MuirWoods/index.html.
    I use Dreamweaver to synchronize all the assets such as menus and links, including the plug-in files (Lua pages).  Each web gallery is published to its own folder in my website.  It works great except that every time I publish/republish a web gallery, I have to scroll and identify the directory in the Export / Save Web Gallery dialog box (or type the file (directory) name in for an initial export/publish).
    I have created a panel text box and variable (metadata.directoryPermalink.value) that can contain the directory name.  By storing this directory permalink along with the web gallery, I hope to ensure that each gallery is always published to its correct directory...
    ... except I don't know how to pass this variable to the export dialog box (as "File name" which actually is the directory name all the gallery files are exported to.
    Do I specify this in the manifest?  I don't see references in either the manifest or galleryInfo files... or in the sdk LrWebViewFactory section.  Perhaps I've missed it?
    Any help appreciated!
    Thanks,
    jk

    Hi,
    I haven't tried to write a web engine so don't know the answer off the top of my head. A quick glance at the SDK guide and the two SDK samples didn't give me any hints at the answer.
    Before I nudge one of the gallery developers to see if they know the answer I need to confirm one thing. Can you please confirm you have a file in the same directory as your manifest using the name "myfunctions.lua", and that your require statement looks something like this:
      require "myfunctions"
    (Thie filename should be considered case sensitive).
    I know its an obvious question but I need to ask before I ask one of the others for assistance.
    Matt
    UPDATE: It might also be worth having a look at Sean's 3 post series on web galleries, which is the only other resource I can recall re building web galleries.
    Added additional resource re web gallery development

  • How to upload pdf file format in unix file directory?

    how to upload pdf file format in unix file directory?

    Hi Karthikeyan,
    If you have PDF internal table with you, You can follow the below method to upload into Unix directory.
        DATA:file_path TYPE char100 VALUE '/usr/sap/tmp/rep_out.PDF'.
        OPEN DATASET file_path FOR OUTPUT IN BINARY MODE.
        IF sy-subrc EQ 0.
          LOOP AT it_pdf.
            TRANSFER it_pdf TO file_path.
          ENDLOOP.
        ENDIF.
        CLOSE DATASET file_path.
    Thanks
    Venkat.O

Maybe you are looking for