Get path  of project

Hi,
in javafx 1.3 the local path is : {__DIR__} .
in Javafx 2.0 ?
Thank

There isn't. But you can get the ClassLoader of your main class that extends Application like so:
package fxtest;
import javafx.application.Application;
public class Main extends Application {
    public static void main(String[] args) {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        String img_url = cl.getResource("fxtest/images/duke.png").toExternalForm();
        System.out.println(img_url);
}

Similar Messages

  • Cycle was detected in the build path of project

    Hi
    I was trying to create a Test application for MDB.
    Here from the webContent I call the service locator in the EJB folder and get the bean object. Using the object I need to put a message in the MQ.
    The onMessage method<present under EJB folder> picks up the message<which is a key> and then it has to refer the value in the Map which is under the ../WebContent/Javasource/..
    But when I try to complile the project it is giving a error stating that A cycle was detected in the build path of project: MDBTestEJB.
    How do I solve this ?? Please help ?

    The fix for this - regardless of IDE - is to use a
    bit of common sense, and good old-fashioned logic
    (remember that?). You've obviously got (at least) 2
    things that are dependent on each other, which - if
    you remember the Chicken and Egg problem* - can't
    possibly work. Work it out for yourself, you're
    writing software, after all. If A needs B to do some
    work but can't because B needs A first, you've got
    problems
    * sensible "it was the egg. Something
    not-quite-like-a-chicken-but-close mated with
    something-else-not-quite-like-a-chicken, and produced
    an egg that eventually hatched into a chicken"
    notwithstandingOK georgemc, I allowed you to motivate me to look for a better fix. I think I came up with a solution but I'd like to see if you, or anyone else, agrees with it.
    First let me say that I'm using a persistence layer, which I've never done before, and with cardinality annotations different classes need to reference each other cyclically.
    My problem was that I had class A in project 1 that depended on class B in project 2, but class B (project 2) also depended on class A (project 1). This meant that I had project 2 on the project 1 build path and vice versa; which is why I was getting the error.
    After your post I started to think about it and it seems that my original solution didn't do a very good job of utilizing the extensibility that Java's OO gives us. My new solution is to remove any reference of class A that is in class B and also remove project 1 from the project 2 build path. Then extend class B into class ChildOf_B in project 1 and insert the references to class A in the new child class. I of course keep project 2 on the project 1 build path.
    I've since told eclipse to throw an error for build path cycles instead of a warning and I no longer have any problems.

  • Could not get metamodel for project

    Hallo
    Something strange happened...
    I developed ein Composited Application under SAP Netweaver 7.1 SP 3.
    Today I changed some code and run build.. And I get the error could not get metamodel for project.
    And furthmore illegal reference to a non-used resource found.
    Any Hints to resolve this problem?
    Thanks in advance
    Kind Regards!
    Ping

    Hallo
    Thanks for your reply!
    The stacktrace I dont' have. Because I had the problem before the build. Thus I cannot have any trace on the server... I don't know where I can find the trace in Devstudio.
    I closed all the project and Reopened again. Now I only have the problem as followed: (in the problem tab)
    Severity and Description     Path     Resource     Location     Creation Time     Id
    Could not get metamodel for project LocalDevelopmentLocalDevelopmentzukoprototyp(2fdictionarych.post.it.sap          LocalDevelopmentLocalDevelopmentzukoprototyp(2fdictionarych.post.it.sap     Unknown     1200043648781     35143
    But I can build the projekt and redeploy it.
    Thanks anyway and have a nice day!
    Ping

  • Need help with error on Lion Server (kernel: add_fsevent: unable to get path for vp ..)

    I have had some Xsan issues and one of my volumes kept failing. I did a complete hard reboot of the entire system after trying all the cvfsck options. Now the volume seems to be ok but I am now getting the following errors and can not figure out what they are. Any help to a new Admin would be greatly appreciated.
    5/7/12 1:59:13.000 PM kernel: add_fsevent: unabled to get a path for vp 0xb129000.  dropping the event.
    5/7/12 1:59:15.000 PM kernel: add_fsevent: unable to get path for vp 0xb12a4d0 (live.0.indexHead; ret 22; type 4)
    5/7/12 1:59:15.000 PM kernel: add_fsevent: unabled to get a path for vp 0xb12a4d0.  dropping the event.
    5/7/12 1:59:15.000 PM kernel: add_fsevent: unable to get path for vp 0xb129de0 (live.1.indexHead; ret 22; type 4)
    5/7/12 1:59:15.000 PM kernel: add_fsevent: unabled to get a path for vp 0xb129de0.  dropping the event.
    5/7/12 1:59:15.000 PM kernel: add_fsevent: unable to get path for vp 0xe3964d0 (live.2.indexHead; ret 22; type 4)
    5/7/12 1:59:15.000 PM kernel: add_fsevent: unabled to get a path for vp 0xe3964d0.  dropping the event.
    5/7/12 2:01:22.024 PM mdworker32: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
    5/7/12 2:01:22.525 PM com.apple.mdworker.pool.0: PSSniffer error: Invalid argument
    5/7/12 2:01:24.697 PM mdworker: FontImporter: Validation failed - "/Volumes/Matilda/Dexter/Randy project - Burke update/James E Burke Awards video revision/Past Video files/ETH742/tricyclestudios (After FX) Jeremy/Assets/FUTURA_4.TTF".
    5/7/12 2:01:24.697 PM mdworker: FontImporter: Validation Result - "(
        kATSFontTestSeverityFatalError
    Then I got a few more of the errors like the top lines.
    Please help!!
    Thanks,
    Kevin Rosenthal

    Turns out there were disk issues that I repaired by rebooting into Lion Recovery Mode (restart, hold Command-R during startup) and running Disk Utility. Disk Utility reported:
    Volume bitmap needs minor repair for orphaned blocks
    Invalid volume free block count
    It fixed both problems and the drive then verified clean.
    While I was there, I also repaired permissions, though I doubt that the permission oddities were the cause of the errors.
    After rebooting into normal Lion, two things happend:
    Time Machine quite happily went back to work and took a backup, no issue. Several hourlies have run since then, no problems.
    Spotlight did some re-indexing. This caused some hangs (spinning beachballs) at first, but it self-cleared. It definitely didn't last long enough to re-index the entire drive; I'm guessing that it needed to re-index some of the repaired sections.
    So far as I know, no files were corrupted -- but the drive is about 80% free space, so odds are that the orphaned blocks were not in a critical area.

  • Why am I getting the message "project could not be prepared because an error occurred. (File already open with write permission)" when trying to share my imovie to media browser?

    Why am I getting the message "Project could not be prepared because an error occurred. (File already open with write permission.) when trying to
    share to the media browser?   I have done this many times before and never got this message.  This is very frustrating.  Can anyone help me?

    Hi
    Error -49 opWrErr  File already open with write permission
    Trash the preference files while application is NOT Running.
    Easiest way to find out if this is the problem is by:
    • Create a new User-Account
    • Log out of Your old one and into this
    • Re-try iMovie
    If it now works OK - then 99.9% the problem is iMovie pref. file that needs to be trashed.
    from Karsten Schlüter
    Some users notice on exporting larger projects from within iMovie that this operation is aborted with an 'error -49'
    This issue occurs only on MacOs machines using 10.7x
    try switching-off the Local Mobile Backup
    in Terminal copy/paste
    sudo tmutil disablelocal
    Re-launch Mac
    Yours Bengt W

  • HT4436 I have a 5 year old Mac Book with OS 10.6.8 and it can not be upgraded to Mountain Lion.  I just got an iPad with retina.  How do I get an iMovie project onto my iPad?

    I have a 5 year old Mac Book with OS 10.6.8 and it can not be upgraded to Mountain Lion.  I just got an iPad with retina.  How do I get an iMovie project onto my iPad?

    I have a 5 year old Mac Book with OS 10.6.8 and it can not be upgraded to Mountain Lion.  I just got an iPad with retina.  How do I get an iMovie project onto my iPad?

  • Import Issue : "Database error: can't get path to master" when attempting to import photos (referenced method)

    Hi Everyone,
    I have a NAS (Network Attached Storage) which holds my photos. I want to import them into Apple photos (but via the reference method).
    I did this by going to Preferences/General and unchecking the 'Importing: Copy items to the Photo library' option.
    I connect to my NAS via AFP and have mount 'Media' which is where my photos are stored.
    I select the file/import option, navigate to aforementioned photo location and select the "Review for import" button
    I then receive an error which states:
    Unreadable File
    The following files could not be imported (they may be an unrecognized file type or the files may not contain valid data).
    Filename                    Reason
    Filename.jpg              Database Error: can't get path to master
    The above error happens on multiple file types.....
    However ...
    If I tick the option in the preferences/general to 'Importing : Copy items to photo library" option then the file will import successfully.
    I of course don't want to import the files I want them to be referenced...
    Anyone else experiencing this issue????
    Thanks in advance.
    Benjamin

    If this is a 3rd party application, I would seek out that company and ask for an updated version compatible with 2010, then it would be a matter of simply installing it per their instructions.
    Otherwise, the best course of action is to deactivate the feature from WSSv3 prior to removal. If that is no longer possible, then use
    FeatureAdmin to remove the feature from within 2010.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How to get path to file variable with applescript

    I've tried:
    `set file_path to path of myfile`
    but it's giving me error:
    `error "Finder got an error: Can’t get path of document file ..."`

    Code is:
    set theFolder to (choose folder with prompt "Select the start folder")
    set file_list to every file of theFolder
    repeat with myfile in file_list
        set file_name to name of myfile
        set file_path to path of myfile
        log (file_path & "/" & file_name as string)
    end repeat

  • How to get path or parent folder

    Hello
    I'm overriding method extendedPreAddRelationship on class S_Relationship.
    My purpose is to check whether the document is being put in the correct path or not.
    I can get folder name and document name using following code:
    AttributeValue av;
    av = def.getAttribute(Relationship.LEFTOBJECT_ATTRIBUTE);
    S_PublicObject folder = (S_PublicObject) av.getPublicObject(this.getSession());
    av = def.getAttribute(Relationship.RIGHTOBJECT_ATTRIBUTE);
    S_PublicObject document = (S_PublicObject) av.getPublicObject(this.getSession());
    What I need is the whole path (or at least the parent folder). Can I get path somehow? Or should I try to search parent folders?
    Jaska

    My purpose is to check whether the document is being put in the correct path or not.Hi,
    I had a similar problem - I needed to compare the path of current folder with path from parameters. Because I wasn't be able to get the path of folder, I did it in reverse way, comparing the folders. To get folder from path I needed getRootFolder method, which wasn't in server-side classes, so I extend S_TieFolder class:
    * Analogy of LibrarySession.getRootFolder().
    public static S_Folder getRootFolder(S_LibrarySession session)
    throws IfsException
    S_Folder folder = null;
    try
    Collection c = session.getValueDefaultCollection();
    S_ValueDefault vd = (S_ValueDefault)c.getItems("RootFolder");
    AttributeValue av = vd.getPropertyValue();
    folder = (S_Folder)av.getPublicObject(session);
    catch(Exception e)
    throw new IfsException(21020, e, session);
    return folder;
    In extendedPreAddItem method of S_TieFolder:
    S_Folder paramFolder = (S_Folder)getRootFolder(session).findPublicObjectByPath(folderPath);
    if( this==paramFolder ) ...
    Radek
    [email protected]

  • How to get path of a specified file

    how to get path of a specified folder
    my code is as follows: Iam using struts 1.2
    my directory structure in tomcat/webapp is as afollows:
    sfq
    |
    | _ _xml
    | |     
    | |_ _ sqx_read.xml
    |
    |__jsp
    |
    |__WEB-INF
         |
         |_ _classes
              |
              |_ _ReadXml.class
    Now i have to get the path of a sql_read.xml file which is in xml folder from ReadXml.java file. pls it's urgent

    Urgent or not, you can obtain the document root directory as
    ServletContext.getRealPath("/")

  • Getting path to application associated with file type

    Hello,
    I'm looking for a platform-independent way to get path to application associated with given file type. Desktop API introduced in JSE 1.6 seems to do this, but it only lanuches the app.
    Any suggestions will be apprecieted

    Okay then, how can I open the file in it's associated
    application AND get the Process object of app's
    instance?If it doesn't bother you that the app will only work on windoze, then you can use the shell "start" command on the file.
    Process proc = Runtime.getRuntime().exec(new String[]{"cmd", "/C","start",filePath});However waitFor() will only wait for the process to be launched, not completed. Since your program doesn't know what Windoze will choose to launch, this makes sense.

  • How to get path of downloaded file?

    Hi,
    I use JDeveloper 11g with ADF.
    I have to download file with original date. If i want to save date i have to zip file. After that to unzip. My queation is: when clien download file how to get path of downloaded file????
    Because, i want to save unziped file on location where client want to download.

    Hi,
    you cannot download a file directly to a client. If this is a requirement then you need a signed Java Applet to handle the download. Otherwise a download dialog is opened for the user to define where to store the file.
    Frank

  • I have recently update to the OS Maverik and I use a projector with a mini display port adaptor to my MacBook Air, ever since the only thing that projects is my desktop picture.  I cannot get it to project my school work that I need to teach my students.

    I have recently update to the OS Maverik and I use a projector with a mini display port adaptor to my MacBook Air, ever since the only thing that projects is my desktop picture.  I cannot get it to project my school work that I need to teach my students. Help!

    Hi Becki514,
    Welcome to the Support Communities!
    The following articles may help you with your projector issue:
    Apple computers: Troubleshooting issues with video on internal or external displays
    http://support.apple.com/kb/ht1573
    Apple Mini DisplayPort adapters: Frequently asked questions (FAQ)
    http://support.apple.com/kb/ht3382
    Mac notebooks: How to use your computer in closed clamshell (display closed) mode with an external display
    http://support.apple.com/kb/ht3131
    I hope this information helps ....
    Have a great day!
    - Judy

  • GetCoreResourceModificationDate could not get path to timestamp file

    Porting my InDesign CS5.5 Plugin to InDesign CS6, when I build a debug version of the plugin and deploy it to the  InDesign CS6 Debug version and launch InDesign I get "PlugInData::GetCoreResourceModificationDate could not get path to timestamp file: C:\Program Files (x86)\Adobe\Adobe InDesign CS6 Debug\Plug-ins\SCC\(SCCINDDEXTRACTION V7.1.0.17 FOR CS6 Resources)\timestamp.idrc" which suggests that InDesign is expecting to find a "timestamp.idrc" file in the root of my plugin's resources subfolder. I have searched the sdk and google and have found nothing about a timestamp resource for InDesign plugins. Is my plugin resource (.rc or .fr file) supposed to include some kind of timestamp that would cause the resource compiler to generate a timestamp.idrc file?

    OK, I fixed this, but not sure how.
    I think the cache was corrupt.

  • HOW CAN I GET ORACLE DEMO PROJECT, SAMPLE PROJECTS.....

    how can i get oracle sample projects on forms and reports...........
    give me the link so i can download it and look at it how it works
    thanks

    You're looking for Microsoft Access. Try www.microsoft.com.
    Using Oracle Forms requires an Oracle database instance. It is client-server architecture. It is not a matter of merely downloading example-install.exe, installing it, and being on your way looking at "how everything works".
    That is what you are seemingly expecting. And in that case, you do not want to use Oracle. You want to use a mickey mouse little file based database tool like MS Access.

Maybe you are looking for