JFileChooser - change default directory

Hi all, I've tried reading the tuts for jfilechooser but still am quite lost as how to change the default directory. I'm trying to change the directory to where the .java file is located. Thanks in advance!

JFileChooser Javadoc
public JFileChooser(File currentDirectory)
    Constructs a JFileChooser using the given File as the path. Passing in a null file causes the file chooser to point to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.
    Parameters:
        currentDirectory - a File object specifying the path to a file or directory

Similar Messages

  • How to change default directory of exe file

    I have created a VI that reads a template and writes on the template and saves it to a new file. When i created to an exe file, I would like for this exe to be able to be used on any computer. As such, the directory where i will open my template will change on different computers. Hence I am having this problem of how to change my VI such that it will choose this template in a new computer and set it as its default directory.
    I understand that in my own computer, I can simple "set current values as default" so that my VI will always open this file from a particular path. But what i need help with is when i put it on another computer where the particular path would definitely be different. I tried using the config file.vi but I could not understand how it is used.
    Please assist me in this. Thanks

    Hi Aaron,
    Micorsoft suggest to use folders like UserAppData to store files for your own programs.
    Put your template in there and use GetSystemDir function to get the UserAppData path...
    Or you put the template in the program folder or one of it's subfolder (not recommended by MS) and use a relative path to load it...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Change default directory for Creative files (such as Media Databa

    I'm using a Zen xtra with WinXP Pro on my company laptop. The Creative software puts a lot of files (7 MB!) in my user profile under Document and Settings. Unfortunately, this is making my profile larger than my company allows, since they back up the profile over the network.
    How can I change the default directory for these file? I can't find any .ini files that might declare the path, and I can't find anything in the Windows Registry that points to my profile.
    Help please?
    Thanks,
    Luke

    Thanks for the suggestion of deleting the JetFileBackup folder, Micromouse. I'll try it.
    Any other files look deletable? Without any way to move them, I may have to try deleting some and see what happens.
    I'm not even sure which Creative programs can be uninstalled (other than Nomad Explorer) and still be able to use MediaSource to play songs from my Zen Xtra (through a USB connection). Windows Add/Remove Programs says that I've used all of these programs today:
    Creative Jukebox Driver
    Creative MediaSource
    Creative MediaSource AudioSync Plugin
    Creative MediaSource NOMAD Jukebox 2/3/Zen Plugin
    Creative NOMAD Jukebox Zen Xtra
    But all I've done is open MediaSource and start a playlist from my Zen Xtra. Anybody know which of those can be uninstalled without affecting my use? (Maybe this deserves a separate topic.)
    Thanks,
    Luke

  • Changing default directory for iTunes Library.itl and iTunes Music Library.

    I need to change the default directory for the files iTunes Library.itl and iTunes Music Library.xml permanently.
    It must be relocated from the My Documents directory due to VPN reasons.
    Has anybody an idea if this is possible? I could not find a corresponding registry entry.
    Notebook Windows XP Pro

    Using TweakUI to Move or Create Your Library/My Music Location
    Use TweakUI (See: ’Disk is locked’ or ‘iTunes folder cannot be found’ when installing or opening iTunes ) to create a 'My Music' folder in a spot where you desire. iTunes should then find this location and deposit its Library files there, and the 'iTunes' folder and sub-folders as well (if you direct it to).
    First, see this Article for some background information: What are the iTunes Library files?
    If you cannot see the ‘My Music’ folder within the TweakUI drop-down selection, proceed on to the following:
    1 On the start menu go to ‘Run’
    2 Type in RegEdit
    3 Navigate in RegEdit to HKEYCURRENTUSER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
    4 Delete any entry for ‘My Music’
    5 Navigate up the tree to HKEYCURRENTUSER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
    6 Make sure there is an entry for ‘My Music’ and is pointing to C:\Documents and Settings\[username]\My Documents\My Music (you can edit the value by double clicking it)
    7 Close RegEdit
    8 Reboot
    iTunes &/or TweakUI should now be able to find the folder.

  • Changing default directory.

    Hello
    Whenever I try to launch a VI, the dialog box start with my document directory,
    but I prefer to change it.
    How can I do it.
    T.U in advanced
    P.S All my games with Tools/options/paths didn't helped.

    How do I change the default drive for downloads and installs to d:\program files or d\program files(x86) in Windows 8? I have installed a ssd boot drive and use it  as windows boot and upgrade drive. It's a 300gb drive with 280gb operating space and
    95gb free. I don't want programs automatically installing to this drive. I have to keep changing the drive letter during installs (and some installs don't even ask).

  • Configuring apache and changing default directory

    I'm a new-bee at this..
    I started Web sharing but I would like to change location..
    And Configuring apache.. :o)
    also would like to learn more about apache for beginners LOL :o)
    Thank you.. :o)

    I edit httpd.conf as you noted.
    #DocumentRoot "/Users/imac_willie/Sites"
    DocumentRoot "/Volumes/iMac-2/MyWebpages"
    #<Directory "/Users/imac_willie/Sites">
    <Directory "/Volumes/iMac-2/MyWebpages">
    Not working..
    In the System Preferences -> Sharing -> Web Sharing
    I click on http://10.0.1.2/~imac_willie/ it still points to "/Users/imac_willie/Sites"
    The DocumentRoot is the default web page. It does not control the ~/imac_willie location. I'm not sure what you change for that, so I would suggest going to Google for that information.
    I did see /private/etc/apache2/extra/httpd-userdir.conf referenced in /etc/apache2/httpd.conf, however, looking in that file only seemed to specify 'Sites' as in ~username/Sites.
    That file also mentions /private/etc/apache2/users/*.conf, as if maybe you can have some kind of per username.conf file that somehow does something, but I do not know what should be in that file, as my system does not have any examples. Again, maybe Google would be helpful.
    When I click on http://10.0.1.2/ "Error Forbidden You don't have permission to access / on this server."
    I'm guessing that the permissions on /Volumes/iMac-2/MyWebpages did not allow user _www access to the files (_www is the account that apache runs under).
    What are the permissions for /Volumes/iMac-2 and /Volumes/iMac-2/MyWebpages and /Volumes/iMac-2/MyWebpages/index.html ???
    Then again, what do you have against /Library/WebServer/Documents?
    Nothing in this directory but "index.html.en"
    Well you are welcome to put your own stuff there if you like.
    NOTE: I'm not an Apache expert, and I do not play one on TV. I have messed with Apache just enough to have a group web site on my Mac at work (in /Library/WebServer/Documents), but not much beyond that.

  • Changing default directory locations

    I have Vista RC1 installed on a boot partition of my PC, I have changed the default location of "Documents" to my F: drive. Now I want to be able to change the defult location of "Public" folders, so that the dat ais stored on my G: drive.
    I have tried to do this , but when i look at the Properties of Public\Music for example, it will not let me change the location value.
    Does anyone know how i can get around this?
    Adrian

    How do I change the default drive for downloads and installs to d:\program files or d\program files(x86) in Windows 8? I have installed a ssd boot drive and use it  as windows boot and upgrade drive. It's a 300gb drive with 280gb operating space and
    95gb free. I don't want programs automatically installing to this drive. I have to keep changing the drive letter during installs (and some installs don't even ask).

  • Changing default directory in Tomcat

    Hi
    First I aplogize for posting this thread as it has nothing to do with Java. But I dont know any friendly and quick forum like this one!
    Here is my current problem:
    Any time any of my web Application tries to create a file in current directory, it creates that in the desktop. That behaviour might be default in TOMCAT. Is there any way to reset it so that current dircetory will be: "C:\Documents and Settings\[user]\ " instead of "C:\Documents and Settings\[user]\Desktop\ "
    Thanks in Advance

    here is the content of start.bat
    @echo off
    if "%OS%" == "Windows_NT" setlocal
    rem ---------------------------------------------------------------------------
    rem Start script for the CATALINA Server
    rem
    rem $Id: startup.bat,v 1.5 2004/03/28 06:40:44 mturk Exp $
    rem ---------------------------------------------------------------------------
    rem Guess CATALINA_HOME if not defined
    set CURRENT_DIR=%cd%
    if not "%CATALINA_HOME%" == "" goto gotHome
    set CATALINA_HOME=%CURRENT_DIR%
    if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
    cd ..
    set CATALINA_HOME=%cd%
    cd CURRENT_DIR
    :gotHome
    if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
    echo The CATALINA_HOME environment variable is not defined correctly
    echo This environment variable is needed to run this program
    goto end
    :okHome
    set EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat
    rem Check that target executable exists
    if exist "%EXECUTABLE%" goto okExec
    echo Cannot find %EXECUTABLE%
    echo This file is needed to run this program
    goto end
    :okExec
    rem Get remaining unshifted command line arguments and save them in the
    set CMD_LINE_ARGS=
    :setArgs
    if ""%1""=="""" goto doneSetArgs
    set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
    shift
    goto setArgs
    :doneSetArgs
    call "%EXECUTABLE%" start %CMD_LINE_ARGS%
    :endI dont know what to look for. Help needed. Thanks

  • Change Default Directory?

    I purchased a new 08 Mac Pro and installed 4 hard drives and one was specifically for iMovie and to store all of the family movies. I downloaded my first movie today on the Mac Pro and it placed the movie in my iMovie Event folder on my main HD. Is there any way to direct all of the movies to the drive I have for the family movies? I sure can't find an adjustment.
    Thanks for any input.
    Denny

    I downloaded my first movie today on the Mac Pro and it placed the movie in my iMovie Event folder on my main HD. Is there any way to direct all of the movies to the drive I have for the family movies?
    Read the options offered in the "Import" window when it opens:
    Example A - "Import from Camera..." window
    Example B - "Import iMovie HD Project..." window
    Example C - "Import Movies..." window
    You will note that each window offers the user an option to select both the target drive and the target Event to which to save the imported object. This, of course, assumes that the drive is properly formatted and is visible to the Finder. As to any "Default," iMovie '08 normally defaults to the Event and drive combination currently open when the "Import" menu option is selected.

  • Javax.swing.JFileChooser -- open button change current directory... Why?

    Hello community.
    I use javax.swing.JFileChooser class. After press open button, JFileChooser change current directory. Why?
    I was not find in documentation about changing curret directiry by JFileChooser. Take me please reference to doc for understanding this effect.
    Thank you.

    This is my code:
    private void jFileChooser1ActionPerformed(java.awt.event.ActionEvent evt) {                                             
    // TODO add your handling code here:
    // label1.setText("3: "+evt.);
    // label1.setText("3: ");
    label1.setText(evt.getActionCommand());
    System.out.println(evt.getActionCommand());
    if (evt.getActionCommand().startsWith("Approve")){
    label1.setText("You push Open key");
    System.out.println(jFileChooser1.getCurrentDirectory().getPath());
    label1.setText(jFileChooser1.getCurrentDirectory().getPath());
    }else{
    label1.setText("You push Close key");
    I not add method for change current directory. But after press on open button javax.swing.JFileChooser class was change current directory.

  • JFileChooser: changing file type resets current directory

    I create a JFileChooser with multiple file types and set the current directory. It comes up with the first file type and the current directory. If I select another file type, the files shown are not in the current directory, which I set -- they are files in the application default directory. Is there a way to keep my current directory, while changing the file type? Or is this a feature?

    Are you talking about your own CDs imported to iTunes or are you talking about songs purchased from the iTunes Music Store (iTMS)? If the latter, the iTMS, you do not get any choice in the format downloaded. You get protected AAC files and that is all.
    If you want to change how you import files, go to the iTunes preferences for importing and choose the format you want to use from now on.
    Patrick

  • How to change the default directory from within SQL*Plus ?

    Hello,
    I want to change the default directory directly from within SQL*Plus to be able to launch my command files with simple instructions like :
    @my_command.sql
    If I haven't launched SQL*Plus from the directory containing the file my_command.sql, how do I change the default directory to the directory of my command files ?
    I've searched through the Oracle documentation, there's no SET DEFAULTDIR or something like that. When I do a SHOW ALL, there's no variable containing the default directory.
    If you have an idea...
    regards,
    Jérôme.

    Hi Jérôme (J鲴me ?),
    You cannot directly do that, but you can use @@ instead of @ to run subscripts in the same directory as the superscript
    # head /tmp/tl30/xxx/[xyz].sql                    
    ==> /tmp/tl30/xxx/x.sql <==
    prompt call y
    @y
    prompt call z
    @@z
    quit
    ==> /tmp/tl30/xxx/y.sql <==
    prompt i am in y
    ==> /tmp/tl30/xxx/z.sql <==
    prompt i am in z
    # pwd                                             
    /root
    # sqlplus -s scott/tiger@lsc62 @/tmp/tl30/xxx/x.sql
    call y
    SP2-0310: Datei "y.sql" konnte nicht geöffnet werden
    call z
    i am in zKind regards
    Laurent Schneider
    OCM DBA

  • How to Change Default User Directory without changing System Directory

    Hi Everyone,
    I need to change default User Directory for my JDeveloper 11.1.1.0.2.
    Default User Directory = C:/JDeveloper/mywork
    Default System Directory = *<JDEV_HOME>/System*
    Now I Need to Change it to
    My Default User Directory = C:/Monty/JDev11g2/
    But System's Default Dir = *<JDEV_HOME>/System*(Same)
    For this i explicitly Set variable ide.user.dir to C:/Monty/JDev11g2/ in JDev.boot file as explained in Installation document.
    Working fine but it contains System Folder too. I don't want this.
    Any Help to find me separate these both as it works for Single User.
    Thanks,
    Fizzz...

    Hi John, You must be right if i'd believe in ghost, A Ghost of System's Folder :-). Well that's true, We should ignore it. But still If someone finds any Clue then let me know.
    Thanks
    Fizzz...

  • How to change default compile directory tmp_ejb?

    Dear all,
    Someone knows how to change the default directory "tmp_ejb...." in WebLogic Server
    7.0?
    This is the default directory where WebLogic Server 7.0 generates and compiles
    the EJB's declared in config.xml.
    I try to specify the attribute TmpPath="ANOTHER_TMP_LOCATION_DIRECTORY_FOR_EJB"
    in the EJBContainer node but still doesn't work.
    The same thing happens when I test this attribute on EJBComponent declaration.
    Someone knows if there is an enviroment variable that specify this tmp_ejb location
    path?
    It's false that the tmp_ejb is located where the config.xml file is placed.
    I have 3 weblogic servers and they haven't the same behaviour.
    Someone can help me??????
    Thanks.

    I ran into the same problem and was wondering if you got an aswer the question you posted in BEA's news group: "How to change default compile directory tmp_ejb?
    Thanks

  • How do I change the "Default Directory" associated with my subscription?

    I was recently added as an administrator for a client's Azure subscription.  This has caused his account AD to be the default directory I see when I log in.  So every time I log in I have to open the Subscriptions menu and change the FILTER BY
    DIRECTORY option.  How can I make my own directory the default directory when I log in?
    Note: there was an almost identical question back in Dec 2013 and the solution was to have the other user remove you as an administrator.  The marked answer suggested the questioner read some arcane description of Azure subscriptions and Active Directory.
      I need to remain an admin for the other account and the referenced document had nothing useful to say about my problem.
    Anyway, thanks in advance for your help.

    Hi,
     Thank you for posting.
     I hope you find the following link helpful.
     http://itproguru.com/expert/2014/07/change-azure-subscriptionsgo-directly-to-a-specific-subscription-in-windows-azurestep-by-step/
    Regards,
    Nithin Rathnakar.

Maybe you are looking for

  • Imessages do not appear in conversation only main menu

    When I receive a text message and respond to it, if the sender sends another text, it does not appear in the on-going conversation. The "messages" arrow at the top of the screen (to the left of the sender's name) displays a number to indicate the per

  • Skype number as Caller ID

    How do I ad my son in South Carolina, on a Skype video call? 

  • Which version of Route66 / Navigator do I have on ...

    Greetings all, Been trying for a long time now to figure out which version of Route66/Navigator I have on my N 6110 Navigator.  Is there any way at all to find out?  I've looked through every setting, menu and soforth on my phone (purchased in 2007)

  • Action Link to link Custom Object 3 to Task

    Hello, Im creating a weblink on the task screen that runs a report on Custom Object 3 wtihin a new windows for the user to select the option on the report that the user would like to add. How can i create a action link that when selected will pass th

  • Exel XML Export Totals Adding Five Zeros

    Hello, When we are exporting FBL5N to Excel using the Excel XML format the totals are exporting to Excel with an additional five zeros added to the total lines.  The line items are exporting correctly it is only effecting the total lines.  Please see