Making JFileChooser search directory program is in

Anyone know how to make a JFileChooser search the directory in which the program is running? When the JFileChooser opens, I want it to show me the contents of the directory the application is in. Under NT, JFileChoosers seem to default to the user's home directory.

This should give you the working directory... At least it does in 2000..
System.getProperty("user.dir")
Hope this helps.
Kirk

Similar Messages

  • Configuring dynamically loaded VI's search directory for both 64 and 32bit

    Background:
    I have an application that has been developed, built in LV2012 32bit.  It needs to run on a 32bit and 64bit machine (Win7, I understand the application itself will only ever be 32bit, but it needs to run in both environments).  The application dynamically loads a bunch of VI's which are raw vi's on disk (think just copy directory of files over from developer machine to the target machine that already has a exe running -- and just a copy, not a build of any sort).  All of these dyanamically loaded vi's at some point reference vi.lib, so I have a few things I need to do to the application to get it to work
    a) within the .ini file for the running exe viSearchPath=......C:\Program Files (x86)\National Instruments\LabVIEW 2012\<<bunch of directories>>\*
    b) within the VI object cache directory, I have a lvDistPath.txt file that includes C:\Program Files (x86)\National Instruments\LabVIEW 2012
    This works just fine for when I deploy these files and run the application on a 64bit version of Win7.  However, when I try to run the application on a 32bit version of Win7, it breaks -- LabVIEW is installed in C:\Program Files\.... (no (x86)).
    I am stuck with the dynamic loading architecture we have, and I can't start making changes to my code because it's not my code that is specifying where to find the files -- it's LabVIEW's internal searching algorithm.
    What can I do (short of managing two separate .ini & .txt configuration files, one set each for x86 and 64bit and managing two separate installers) to get around this problem?

    It sounds like you really don't have a problem with a 32 bit app vs. a 64 bit app.  It sounds like a problem with file paths being different on a 32 bit app on 32 bit windows vs. a 32 bit app on 64 bit windows.
    Two things you could do.
    1.  (Not sure this would work.)  Put 2 paths in the search directory, one for c:\program files path for 32 bit windows, and one for c:\program files (x86) for 64 bit windows.  One or the other will exist.  I don't know if something will hangup if it searches the other path that doesn't exist.
    2.  Since you are dynamically loading the VI's, you should specify the path when you are dynamically loading them rather than having LV search for them.  There is a function called Get System Info in the File I/O >> File Constants palette that will return the path to the Program Files folder for you environment so that you can build on that to get to your dynamic VI path.

  • Custom Icon can be loaded from search directory

    Currently Custom Icon can only be placed under 
    C:\Users\Public\Documents\National Instruments\TestStand 2014 (32-bit)\Components\Icons
    and
    C:\Program Files\TestStand 2014\Components\Icons
    and also from 
    search directory option for icon (New Idea)
    If icons can also be loaded in path mentioned search directory, It help a lot in handling things among a large ATE Team (50 Test Developers)
     

    I made the zip file with WinZip in the same directory as the class file,
    as directed by the previous thread, and uploaded it to my server.
    It still does not load the applet.
    Here is my webpage:
    http://www.geocities.com/shaolin_bi/scopeApplet.html
    Can someone please take a look and tell me what I am doing wrong?
    Thanks.

  • Search Indexing Program failed. java.lang.ExceptionInInitializerError

    I have BusinessObjects Edge SP3 installation. Got error with Search Indexing Program. The error says: "The program failed to run and supplied the following information: java.lang.ExceptionInInitializerError".
    Some points I would like to get clearified in the scheduling event:
    1. What is the user name and password for the program logon.
    2. What should we have in the Working Directory and Classpath under Program Parameters
    I suspect that error happens when these fields are empty.

    James,
    While the upgrade of JDeveloper to 10.1.3.4 will take some time, let me clarify the situation.
    We have SOA suite and Oracle application server installed on a server machine and two client machines (one of which I am using) have Jdev installed on them. When I deploy the BPEL from Jdev running on my colleague's machine it works fine but fails when I try the same from Jdev running on my machine.
    The versions of Jdev are exactly the same on the two machines. And versions of SOA suite, Oracle application server etc are naturally same as it is being deployed on same server. Appreciate your valuable guidance.
    Thanks and Regards,
    Dhiraj.

  • How to programmatically add a search directory path

    Is there a way to do this from a CVI program?

    Hello,
    As stated in the previous answers there is no way using the API to do this. However, you can write some code to add a search directory programatically. What you need to do is as follows:
    1. Get a reference to the config file. You do this by calling Engine.ConfigFile. This will return to you a reference to the TestExec.ini file.
    2. Clone one of the elements of the Search Directory list. The search directories are stored in an array, in which each element is a container that has the following fields: Disabled (Boolean), SearchSubDirs (Boolean), FileExtRestrictions (string), Path (string).
    3. Insert the cloned element into the end of the Search Directories array.
    4. Once the element is in the array, you can change any one of the fie
    lds listed above.
    5. Increment the change count and save the config file.
    Note: The changes that you make to the config file will not take effect until you restart the Sequence Editor. This is due to the fact that we cache the config file when the Sequence Editor is loaded.
    I have attached a sequence file that will do this. Depeneding upon the programming environment you are using, you can mimic the actions performed in this file in your code.
    Hope this helps.
    Attachments:
    ModifySearchDir.seq ‏19 KB

  • Setting Search Directory with LabVIEW RTE

    Hi,
    I've LabVIEW 8.0.1 run time engine installed on target computer and would like to run LabVIEW executable on target computer.  I also have required low level support VIs for developed VIs. 
    Question is: how do I set the search directory for low level VIs with LabVIEW run time engine installed on the system.
    Suggestions/comments are appreciated.  Thank you.

    If your hierarchy is the same as was in the IDE, then there won't be a need to search for the VIs. If the VIs are not found where they are expected to be, then LV (including the RTE) starts to search for them first in the folder where the VI\application is and then in the folders in its list. To change the list, you need to place the viSearchPath key in your application's INI file. You can copy this key from the labview.ini file and then modify the paths listed in it.
    Try to take over the world!

  • How to search a program sapscript launcher

    Hello everybody.
    I have to modify a value that it's filled in a sapscript, but I don't know how to do for search the program that launch my sapscript.
    Can you help me, gurus?
    Thanks a lot!

    Hi Alessio,
    first you should know that what  are the modification you want .than goto nace copy the standard script to your ZZ_script than you can adding or modify the layout.
    in the program fallow the these steps:
    Using the PERFORM SUBROUTINES you can call the extra fields info into the script and print them
    see the sample code and do accordingly
    How to call a subroutine form SAPscripts
    The Form :
    /:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
    /:USING &EKKO-EBELN&
    /:CHANGING &CDECENT&
    /:ENDPERFORM
    The report :
    REPORT zkrpmm_perform_z1medruck .
    DATA : BEGIN OF it_input_table OCCURS 10.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_input_table.
    déclaration de la table output_table contenant les
    variables exportées
    DATA : BEGIN OF it_output_table OCCURS 0.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_output_table.
    DATA : w_ebeln LIKE ekko-ebeln,
    w_vbeln LIKE vbak-vbeln,
    w_zcdffa LIKE vbak-zcdffa.
    FORM CDE_CENT
    FORM cde_cent TABLES input output.
    it_input_table[] = input[].
    it_output_table[] = output[].
    READ TABLE it_input_table INDEX 1.
    MOVE it_input_table-value TO w_ebeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = w_ebeln
    IMPORTING
    output = w_ebeln.
    SELECT SINGLE zcdffa FROM ekko
    INTO w_zcdffa
    WHERE ebeln = w_ebeln.
    it_output_table-name = 'CDECENT'.
    MOVE w_zcdffa TO it_output_table-value.
    MODIFY it_output_table INDEX 1.
    output[] = it_output_table[].
    ENDFORM.
    REPORT ZMPO1 .
    form get_freight tables in_par structure itcsy out_par structure itcsy.
    tables: ekko,konv,t685t.
    data: begin of itab occurs 0,
    ebeln like ekko-ebeln,
    knumv like ekko-knumv,
    end of itab.
    data: begin of itab1 occurs 0,
    knumv like konv-knumv,
    kposn like konv-kposn,
    kschl like konv-kschl,
    kbetr like konv-kbetr,
    waers like konv-waers,
    kwert like konv-kwert,
    end of itab1.
    data: begin of iout occurs 0,
    kschl like konv-kschl,
    vtext like t685t-vtext,
    kbetr like konv-kbetr,
    kwert like konv-kwert,
    end of iout.
    data v_po like ekko-ebeln.
    read table in_par with key 'EKKO-EBELN'.
    if sy-subrc = 0.
    v_po = in_par-value.
    select
    ebeln
    knumv
    from ekko
    into table itab
    where ebeln = v_po.
    if sy-subrc = 0.
    loop at itab.
    select
    knumv
    kposn
    kschl
    kbetr
    waers
    kwert
    into table itab1
    from konv
    where knumv = itab-knumv and
    kappl = 'M'.
    endloop.
    loop at itab1.
    if itab1-kposn <> 0.
    select single * from t685t
    where kschl = itab1-kschl
    and kappl = 'M'
    and spras = 'EN'.
    iout-vtext = t685t-vtext.
    iout-kschl = itab1-kschl.
    iout-kbetr = itab1-kbetr.
    iout-kwert = itab1-kwert.
    append iout.
    clear iout.
    endif.
    endloop.
    sort itab1 by kposn.
    loop at iout.
    sort iout by kschl.
    if ( iout-kschl eq 'GSDC' OR
    iout-kschl eq 'GSFR' OR
    iout-kschl eq 'GSIR' ).
    at end of kschl.
    read table iout index sy-tabix.
    sum.
    write:/ iout-kschl,iout-vtext,iout-kwert.
    out_par-name = 'A1'.
    out_par-value = iout-vtext.
    append out_par.
    out_par-name = 'A2'.
    out_par-value = iout-kwert.
    append out_par.
    endat.
    endif.
    endloop.
    endif.
    endif.
    endform.
    IN THE FORM I AM WRITING THIS CODE.
    /:DEFINE &A1& = ' '
    /:DEFINE &A2& = ' '
    /:PERFORM GET_FREIGHT IN PROGRAM ZMFORM_PO1
    /:USING &EKKO-EBELN&
    /:CHANGING &A1&
    /:CHANGING &A2&
    /:ENDPERFORM
    &A1&
    &A2&
    This Code is to be written in the PO form under ADDRESS window.
    /:DEFINE &A1& = ' '
    /:DEFINE &A2& = ' '
    /:DEFINE &A3& = ' '
    /:DEFINE &A4& = ' '
    /:DEFINE &A5& = ' '
    /:DEFINE &A6& = ' '
    /:PERFORM GET_VENDOR IN PROGRAM ZMFORM_PO
    /:USING &EKKO-EBELN&
    /:CHANGING &A1&
    /:CHANGING &A2&
    /:CHANGING &A3&
    /:CHANGING &A4&
    /:CHANGING &A5&
    /:CHANGING &A6&
    /:ENDPERFORM
    &A1&
    &A2&
    &A3&
    &A4&
    &A5&
    &A6&
    Reward is usefull

  • Search scan program for Dell C1765NFW

    Search scan program for Dell Laser printer C1765NFW compatible to OSX Mavericks 10.9.2. For Windows come special program with printer, but for OSX come nothing or just driver for minimal function. Who have any idea which scan program I can buy and use with this type of laser (all in one) printer?
    Many thanks for info!

    Try using Image Capture. It's located in your Applications folder.
    Launch Image Capture then connect the printer.
    The printer/scanner should show up under Devices top left side of the Image Capture window.
    Now look at the bottom left side of the window. Click the: Connecting this (device) opens: pop up menu and select an application to import your photos.
    You can also select a folder to import photos from the Import To: pop up menu.
    Selet the photos you want to import then click Import or Import All on the right.
    More help is available from the Image Capture menu bar. Click Help > Image Capture Help
    Mac Basics: Using a scanner

  • I am making a Conference/Event program book.  Are there mac programs or apps that could help me design this?

    I am making a Conference/Event program book.  Are there mac programs or apps that could help me design this?

        I can see that this issue has been quite extensive, and frustrating, and I am so sorry for all that has happened societygirl! I would like to help you work this issue out. Please follow & send me a Direct Message, so I can get your account specifics and help finally bring this to a resolution.
    Thank you,
    MichelleH_VZW
    Follow us on Twitter @VZWSupport

  • How to search print program

    HI FRIENDS.............
    I know the form name then ,How to search its print program  name?

    Hi Sateesh,
    Use the  NACE transaction:
    Please check this link
    search print program and sap script
    with po no how to find script and  print program for that  po.
    Source : https://forums.sdn.sap.com/click.jspa?searchID=15095030&messageID=5629547
    Have A Good Day
    Chaitanya.

  • Removing search directory by name dynamically

    I have been using the SearchDirectories.Insert method to add search directories in TestStand dynamically.
    Now I am required to remove a search directory dynamically. The problem is that the SearchDirectories.Remove method lets me specify which directory to remove by inputting the index in the list instead of the name/path of the search directory. This is a problem because I will not know at which position is the directory I want to remove in the list.
    Any suggestions??
    Thanks
    Anuj

    Ray,
    Thanks for your reply. I did not think about this. I started implementing your solution by first retrieving the number of directories using the Count property of SearchDirectories, then calling the Item property for each index, then accessing the Path property for each item. I somehow don't see the path getting returned and I can't figure out why.
    I have isolated that code into this VI. Can you look at this and tell me what I am doing wrong?
    Thanks
    Anuj
    Attachments:
    Test.vi ‏12 KB

  • Programmat​ically Inserting search directory

    Hi Ppl,
    I tried programmatically inserting a search directory. I used the method Engine.SearchDirectory.Insert. After calling this method I called the SearchDirectory.Reload method. Despite calling this method the newly added directory was not displayed in the search directories list in sequence editor. When we change Mytypes.ini or other configurations external to sequence editor I get the pop up to reload them. But when I inserted search directory It didnt ask for reloading. I had to restart sequence editor for the new directory to be listed. How do I reload without restarting sequence editor ?
    Below is the code that I used .
    Solved!
    Go to Solution.

    Sathish -
    I believe the behavior you are seeing is expected. When you call the VI stand-alone outside of TestStand, you are creating a different instance of the engine. Thus, you have one instance of the TestStand Engine in the Sequence Editor process, and one instance of the TestStand Engine in the LabVIEW process.
    Now, when you call SearchDirectories.Reload() from the LabVIEW VI, you are telling the LabVIEW instance of the TestStand Engine to reload the SearchDirectories that it has cached from the SearchDirectories on disk, however, this has no effect on the Sequence Editor instance of the TestStand Engine.
    Now, if you were to call your VI as a code module from a sequence that you execute within the Sequence Editor, and you pass the Engine as an input to the VI (RunState.Engine), then you would see the behavior you are expecting.
    You could also try the following as a test: With the Sequence Editor open, run your VI as you have been. Then, in the Sequence Editor, execute a step that calls RunState.Engine.SearchDirectories.Reload() (if you're in TestStand 4.0 or newer, you can simply call this in a Statement step). Then check the Search Directories... have they updated?
    Hope this helps.
    Manooch H.
    National Instruments

  • How to make JFileChooser's directory as a droptarget?

    i able to drop file in the current directory of JFileChooser (on the "look in" of it e.g look in c:\) but when i drop my file to JFileChooser any of the directories which jfilechooser shows mouse cursor shows the disable symbol which indicates that this directory doesn't support drop target i also tried for writable directory but the problem is same.
    this is my code
    File node = chooser.getCurrentDirectory();
         // Only allow a drop on a writable directory
          if (node.isDirectory()) {
            try {
             File f = new File(node.getPath());
             if (f.canWrite()) {
                return f;
            } catch (Exception e) {
          }i think it is the problem of chooser,getCurrentDirectory(); statement.
    what should i have to place instead of this statement.
    Plz help me.

    Note: This thread was originally posted in the [New To Java|http://forums.sun.com/forum.jspa?forumID=54] forum, but moved to this forum for closer topic alignment.

  • Searching of programs/includes/tables based on string

    Hi Experts,
    I have a requirement, is there any program or transaction code to search programs/includes/tables based on the fields
    (Eg. company code, sales organization, country, currency) in the selection screen or any other method. 
    Please suggest, if any solution.
    Thanks,
    GR

    Hi,
    You will not find a program for this requirement & that too based on a field.
    I would suggest if you have the package then SE80 will be the best transaction which will give you all the objects like Tables/programs/FM/Enhancement that come under a package.
    Also if you do a whereused list on fields like Company code, Sales organization, Country, you will end up getting a massive list of objects where it is used.
    Regards
    Abhii

  • Making a telephone directory in InDesign 5.5

    I am trying to make a telephone directory for the entire campus. I have all faculty/staff in a spread sheet, saved it as a csv file. I then put it InDesign - put the appropriate fields then tried to do multiple layouts and I am realizing it doesn't "flow."I thought I would have to create at least two InDesign templates one for the middle and then one for the back but neither flows correctly.
    Can anyone guide me?
    Basically the middle of the book should like this (but with multiple pages that the data flows until the last record)
    Then this is the back of the directory which is in alphabetical order. I don't need to format it this way I just need it to be one record on top of another, then put into a second column then flowed until the last record.
    Thanks!

    ah ok, you never said you were data merging them.
    in short, data merge doesn't have a feature like microsoft word where there is a "next record" TEXT field which lets the records flow on.
    instead, data merge works by merging the elements on the page, so if you were to merge the file and in the options turn on the multiple record feature, you'd see that many text boxes were generated but they're not threaded together... but the text boxes do have record one, then record two, then record three...
    indesign's data merge is best suited to generating data where one record changes per page. yes, it can do many records per page, but this is ideally suited to people who are imposing their own business cards many up on a page; or people making picture heavy catalogues with set amounts of records per page. indesign's data merge is not built for catalogue-style in-line data merges similar to microsoft word's mail merge to catalogue.
    for your purposes, i'd use XML but that is user unfriendly. there are CSV to XML converters online (assuming your database isn't too huge) and a great resource called "A Designer's Guide to Adobe InDesign and XML: Harness the Power of XML to Automate your Print and Web Workflows" written by James Maivald and it is about the only easy to pick up and run with book out there on the topic. There is another book by Grant Gamble on the topic and no offense to him, but my brain was full by chapter three.
    otherwise, aftermarket plug-ins such as ones made by cacidi systems or emsoftware may help.
    or, does this really need to be a data merge solution? could the text not simply be placed into indesign rather than using the data merge feature? i'd imagine the data is already in the correct order, just needs formatting. if that is the case and the excel file is available, i'd save it out as a tab delimited TXT format and place that into indesign and then format it with nested styles.

Maybe you are looking for

  • Front End Tool for JSP

    I'm trying to develop a commerically viable front-end to an existing JSP system.Are there any tools available that make the task of creating a front end(i.e. HTML,XML) easier. For example, nice headers/tabs at the top of each page while keeping usabi

  • Wireless Keyboard Looses Connection

    I have a new Mac Mini with a wireless keyboard and wireless mighty mouse. During use the mighty mouse is fine, but the keyboard seems to loose the bluetooth connection over time, always about the same amount of time. I realize this is probably a powe

  • Download link on report

    Is it possible to disable the download (refresh, printer friendly) links at the bottom of reports that are not on a dashboard?

  • Adding a Map link over an image with a Z Index setting

    I have to add a map invisible link to a spot over an image on a page. If I look in the css file it is as follows #n141     z-index: 143;     position: relative;     width: 253px;     margin-right: -253px; The map must go over the image that covers th

  • Someone please help I'm going crazy

    I went to get my Ipod and it said to connect it to iTones, it's never done this before, but I have a lock code on it, so everytime I try and plug it in it says I must first enter the password. but it won't let me do so because I can not see anything