Current Dir path

I want to be able to load Images into my Swing app from a standard directory. Is there such a thing as relative paths in Java ImageIcon class? Basically I don't want to hard code the path names. For obvious reasons.
What is the starting path?

Cabaal,
Would you be so kind as to post your solution? I am encountering the same issue, and cannot for the life of me figure it out. I'm new to Java, and am using Forte, if that makes a difference. My CLASSPATH appears to be correct (it includes the "." path), but I still cannot load images from the "images" directory of the current project/class.
Thank you!

Similar Messages

  • Get current RID path from file upload in KM

    Hi all,
    I wrote an customized upload application using upload ui element.
    The question is , how can I get the current RID Path when I trigger the WDJ upload action ?
    Thanks for your help. please.

    Hi,
    Here is some of examples from WDJ for uploading the files, please go thr below link i hope it will help you
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a099a3bd-17ef-2b10-e6ac-9c1ea42af0e9?QuickLink=index&overridelayout=true
    http://wiki.sdn.sap.com/wiki/display/WDJava/KmuploadusingWebdynproapplication
    Thanks,
    Sreeni.

  • Get current PDF path when filename has unicode chars

    How do i get the current PDF path if the filename has unicode characters
    Thanks
    Swapneel

    How are you getting it now that it isn't working?

  • Get the current absolute path name?

    How to get the current absolute path and file name in javascript?

    If using CS3 or CS4
    alert($.fileName);
    or this should work on all versions.
    function WhoAmI() {
    var where;
    try {var F = FO;
    }catch( err ) {where = File(err.fileName);}
    return where;
    NB: Neither will work if you are using binary scripts!

  • How to get system temp dir. path on the fly ,system may be XP or Linux ??

    How to get system temp dir. path on the fly ,system may be XP or Linux ??
    please suggest solution

    The default temporary-file directory can be retrieved
    using:
    System.getProperty("java.io.tmpdir")
    Thanks a lot for u r reply this one works !!!!

  • Dir path in expdp

    Hi,
    Can I specify the dir path as normal unix path like below (rather than create a db dir object):
    (directory=/export/home/myname/mydir)
    expdp user/pass
    directory=/export/home/myname/mydir
    dumpfile=sp.dmp
    logfile=sp.log
    schemas=ops
    include=package,function,procedure
    Thanks.

    you can execute the specified direct path except that you have to remove the DIRECTORY parameter.. Without the DIRECTORY parameter the job will run successfully becoz oracle will be maintaining a default datapump directory in $ORACLE_HOME/admin/<sid>/dpump to maintain all the dumpfiles and logfiles of the exports and imports being executed..Cheers!

  • Javac not checking hard coded dir paths???

    I'm a beginner java person...have 17 years in computers experience, most Unix admin. I've been through into a job of trying to troubleshoot someone else's code that is long gone. A GUI window is not displaying and I'm getting java errors in the log files. After going back and trying to recompile the offending .java file, I don't get any errors at all. But on further research, have found a hard coded directory path to a file that doesn't exist on the workstation. Does javac not check all it's directory pointers to outside files during compilation. My experience with C++ was that it did...but java code compiler must not be the same??? I'm using java 1.2 compiler on a Solaris 2.7 workstation.
    Anyone have any suggestions??? I'm befuzzled. Would be greatly appreciated. Thanks, Melisa

    So How will I find all the missing dirs?? I guess with C++ compiler it was the includes that it went out and checked for that I was thinking about. Sorry. I'm string searching the source for all dir paths to files and I'll just have to manually verify they are in existence I guess. Thanks for your answer.

  • Current dir + Runtime.getRuntime() ???

    Hello all,
    I am working on a programming that need execute other exe file. The problem is I have to put that exe file in Window system file directory, then I can execute this exe file. However, what I want is not puting that exe file in Window system, just put that exe file in current working directory. and exe it.
    thanks
    here is some codes, but does not work as I want
    import java.lang.Runtime;
    class TestVB
    {   public static void main(String[] args)
    {  Runtime run = Runtime.getRuntime();
    try{  Process a = run.exec("a.exe"null, null);
    //or
    String path = System.getProperty("user.dir")+System.getProperty("file.separator")+"a.exe"];
         Process a = run.exec(path,null, null);
    catch(Exception es)
    { System.out.println(es);

    Go through this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    it shows the best way to use Runtime.exec() function along with its pitfalls.
    i hope it helps!

  • How to get the current FILE PATH?

    I want to get the File Path on my Java Programming, which class / method can get a File Path on the windows?
    thanks!

    I want to get the current working directory(e.g.
    c:\Tomcat5.0\webapps\)
    If this is a web application you're talking about and you want the directory where that application is installed, that's almost certainly not the CWD. It might be one of the context or whatever variables that's available to servlets. Look in the servlet API and see what's there.

  • Can I search the current set path in a script?

    I have on my machine a folder full of mathscript commands and functions.  This folder is beginning to get quite large and I'd like to be able to clean it up a bit by grouping the files into sub-folders.  For example, I'd like to create the following folders;
    C:\MatrixXTools
    C:\MatrixXTools\StringTools
    C:\MatrixXTools\VariableTools
    Of course, this would be fine if I was to set the path to every folder individually.  What I want to do though, is to set my path manually to C:\MatrixXTools and then put a command in there called 'import'.  The 'import' command would be responsible for searching the current path for a given folder and then adding it to the path when it finds it. So to import the StringTools, I would just call
    import "StringTools"
    All of my base scripts would go into C:/MatrixXTools and then if a script needed to use the StringTools, I could just call the import function.
    The problem I have is that I can't find a command that will return me the path into a string vector.  Is there some way of doing this?  'SHOW PATH' doesn't do what I want it to because it just shows the path and doesn't give me a way of programmatically viewing it.
    Is there a better method of getting everything into sub-folders all together?
    I realise that I could also do this using the startup script, however I have the tools in revision control (svn) so that other people can use them - I don't want to have to get everyone to change their startup script every time I make a new folder - I should be able to do this in the scripts.
    Note: we are still on v62.2 and we are looking into upgrade options.
    Solved!
    Go to Solution.

    You can get the show path output into a string using === operator.
       [showPathStr,] === show path;
    You can break up the showPathStr on the new line characters
    into a string vector using the split function.
    The split function was added in MATRIXx 7.1.9. The split function internally
    uses the index and stringex functions to create the split string vector.
       showPathVector = split(""n",showPathStr);
    If you try out the split function and look at the algorithm you will need to
    download and eval MATRIXx 7.1.9 or higher.
    Also, instead of changing startup.ms everytime you add a tools directory, why not
    have startup.ms execute another script (i.e. execute file = toolsetup.ms) and you
    would only update toolsetup.ms when adding a new tools directory.

  • Can't match home dir path to the actual data

    probably something simple, but I cannot get my students directory to mate up again
    Brief history:
    unstable old world: exported user info, reinported into a clean build....this provides an old path name that was from the previous world and is now not correct
    Created new share points with network mount selected
    I have succesfully managed to re-home all my faculty users (only 60),
    however the 658 students are not playing ball. Different share point
    One thing I've noticed on the HOME screen within WGM: for a user who is a member of that old primary GID, when I click on the newly shared home path in Where, at the top of the screen it only shows
    Home: afp://myservername.mydomain.com/school/username
    where as a faculty member (different primary GID) clicking on the SAME home dir will get:
    Home: afp://myservername.mydomain.com/school/username
    /Network/Servers/myservername.mydomain.com/
    right now I have 658 user with the NONE home selected and they can at least login, onece only they can actually network share to their home but I need them mounting correctly
    TIA

    Tim,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Get current swf path

    I'm developing an extension use Extension Builder for Photoshop CS5. I have to use an executable file in my extension. In general, if you use the Adobe Extension Manager to install the extension, the extension's swf file will put to USERPATH\AppData\Roaming\Adobe\CS5ServiceManager\extensions\YOUR EXTENSION NAME.
    However, some time it isn't. And I don't know the reason. My executable file will be copy to the path as same as the swf file. So I want to get the swf file's path.
    In Flex, the File class has two static variables File.applicationStorageDirectory and File.applicationDirectory. But they don't match the swf file's path.
    How can I get the path in runtime? Solution use Flex or Javascript Script is ok.
    Any help will be appreciated. Thanks!

    "panell" <[email protected]> wrote in
    message news:e97o6o$18i$[email protected]..
    > Hi
    > How to get current flash movie path?
    > ex. C:\Movie1.swf? or
    http://www.test.com/Movie.swf?
    myTextBox.text = _url;

  • Application - current vi path different - config file

    If I want to use config files (ini files) with an application, to store settings between runs of the application,
    I would like to name the conifg file the same as the application, just with a different ending:
    application.ext with config file application.ini
    For this, I am using the 'current vi's path' and work from there.
    I realised that the 'current vi's path' of the application is different from the one of the vi itself, even with the original vi being in the same directory as the application.
    The application returns the vi in a path that includes the applicatinon as a directory.
    e.g.
    \programs\application.exe
    gives path
    \programs\application.exe\original.vi
    Thus, it seems that I need a different way of stripping/appending the path for the original vi and for the application, when creating the path for the configuration file.
    Is there a way around it?
    Is the only way to program a 'smart' stripping tool, that checks if the current path includes an xxx.exe part, and then creates the path for the config file accordingly? (This is what I will do, if there is no simpler solution)
    Thanks for any help,
    Stephan

    Hi Stephan
    You don't need a 'smart' stripping tool. Just check in your main vi if it is run by the LV runtime environment or the LV dev. system. Depending on this, either strip the path once or strip it twice.
    Thomas
    Message Edited by becktho on 12-21-2005 03:12 PM
    Using LV8.0
    Don't be afraid to rate a good answer...
    Attachments:
    StripPath.vi ‏16 KB

  • How can i specify current directory path of wsusscn2.cab

    SCRIPT:
    How can i set current directory file path of wsusscn2.cab where i placed this vbscript, instead of going to c:\wsusscn2.cab.
    =======================================================================
    Dim fso
    Set wshNetwork = CreateObject("WScript.Network")
    strUser = wshNetwork.Username
    Set fso = WScript.CreateObject("Scripting.Filesystemobject")
    Set f = fso.CreateTextFile(".\Missing Patch Details\" & wshNetwork.ComputerName & "_missing_patches.csv", 2)
    Set UpdateSession = CreateObject("Microsoft.Update.Session")
    Set UpdateServiceManager = CreateObject("Microsoft.Update.ServiceManager")
    Set UpdateService = UpdateServiceManager.AddScanPackageService("Offline Sync Service", "c:\wsusscn2.cab")
    Set UpdateSearcher = UpdateSession.CreateUpdateSearcher()
    WScript.Echo "Searching for updates..." & vbCRLF
    UpdateSearcher.ServerSelection = 3 ' ssOthers
    UpdateSearcher.ServiceID = UpdateService.ServiceID
    Set SearchResult = UpdateSearcher.Search("IsInstalled=0")
    Set Updates = SearchResult.Updates
    If searchResult.Updates.Count = 0 Then
        WScript.Echo "There are no applicable updates."
        WScript.Quit
    End If
    WScript.Echo "List of applicable items on the machine when using wssuscan.cab:" & vbCRLF
    For I = 0 to searchResult.Updates.Count-1
        Set update = searchResult.Updates.Item(I)
    f.WriteLine update.Title
    'WScript.Echo I + 1 & "> " & update.Title
    Next
    WScript.Quit
    ==========================================================================
    prakash

    Just remove the c:\ and it will be looked for in the current directory.
    If you want the script how get the script path and remove the file name or use the shell
    currentFolder = CreateObject("WScript.Shell").CurrentDirectory
    ¯\_(ツ)_/¯

  • Archive dir path in inbound file adapter

    I run in an XI2.0 system with a central (on our XI system) inbound fileadapter.
    We need to retrieve inbound interface files from a BW SEM system. I specified the fpt settings and am able to retrieve the file from the specified ftp directory.
    In my file.archiveDir I specified /tmp. What happens now, is that I retrieve the file from the BW SEM system, path, file.sourceDir=/ftpbw/inbound, but that the archived files get stored on the XI system /tmp, and NOT on the BW SEM system /tmp.
    Is there a way I can use the Archive directory on the BW SEM system via FTP ?

    Hi Jan,
    The archiveDir cannot use ftp to archive the files, and it takes the directory on the local drive where the file adapter resides.
    You may try to map the BW system drive from xi system so that BW file system can be accessed directly, or you need to install the file adapter on BW machine.
    In XI2.0, it is recommended to install the adapters close to the business systems (in this case BW system) other than the xi system.
    Regards,
    Hart

Maybe you are looking for

  • Error in Control Framework in smart forms programms

    IN VF02 smartforms ENTRY form , I add a function about save PDF at local PC. When I print the smartfomrs,There is ERROR message in update modules. IN SM13 can see the ERROR message.  Function Module: RV_MESSAGE_UPDATE Status :Update was terminated Er

  • Slow to open PDF files in Adobe Reader

    Hello, after upgrading to Mac OS 8.5.3 and 10.9 Maverick'm slow to open PDF files from a Windows 2003 Server share. In the terminal I get the following errors Print Screen below. PING to the IP of the share is less than 1 ms. I'm working with adobe r

  • Editing multipage PDF in Illustrator for print service bureau

    I have a series of 4-page PDFs that I've edited in Illustrator and resaved back into the original files, which were created in Quark (not by me, and the Quark files are not available). My client will have these printed by a professional service burea

  • Strange error when Bootcamp attempts to create partition for Windows

    I get a strange error when I tell Bootcamp to create a partition for Windows. I get to the Create a Partition stage. I select 20GB for Windows leaving 91GB (39GB free) for OS X. I then click Partition and it gives me the following error *The disk can

  • Workbook - Excecl filter - hierarchy vs flat list selection

    Dear all, On query designer you can hardcode / filter a characteristic either by hierarchy node or characteristic value. The only requirement is to define the hiearchy as active for that characteristic. When filtering you are able to pick either hier