Relative references

I've created an application which uses some images, which are all bundled together in a jar file.
I reference the images using object.setIcon(new ImageIcon("images/Icon1.gif"));This works fine, and I can happily run the applicaiton using: ~user/files/prog/ $ java -jar foo.jarMy problem arises when a user types:~another/ $ java -jar ~user/files/prog/foo.jar My icons aren't loaded, because they can't be found in ~another/images/
Any ideas for this one??
Thanks
Tristan

try:
import java.net.*;
      try {
         URL url=this.getClass().getClassLoader().getResource("images/Icon1.gif");
         object.setIcon(new ImageIcon(url));
      } catch (Throwable e) {
         System.out.println("error");
      }This will make sure that the program fetches the image from the images subdirectory of the directory where the class file is kept.
;o)
V.V.

Similar Messages

  • Flash Relative Reference

    I share maintenance responsibilities for a site with someone else.  We both have Dreamweaver CS4.  She uses Win 7 and I'm on XP.  We had been getting warning messages about Flash objects (swf) possibly not working, so she deleted and reinserted some of the swf files.  Now the swf files do not work when the pages are loaded from my computer, even though they work OK when I load the pages from the site.  I tracked the problem to the relative reference for the swf files.  When she re-inserted the Flash files, Dreamweaver created:
    <param name="movie" value="/images/MyBanner.swf">
    However, when I reinsert the swf files, Dreamweaver creates:
    <param name="movie" value="../images/MyBanner.swf">
    I can change the references in the pages she created from '/' to '../' and the swf files work fine when loaded from my computer.  I have tested this in IE 8.0.6 and Firefox 3.6.2.
    Any ideas.

    I share maintenance responsibilities for a site with someone else.  We both have Dreamweaver CS4.  She uses Win 7 and I'm on XP.  We had been getting warning messages about Flash objects (swf) possibly not working, so she deleted and reinserted some of the swf files.  Now the swf files do not work when the pages are loaded from my computer, even though they work OK when I load the pages from the site.  I tracked the problem to the relative reference for the swf files.  When she re-inserted the Flash files, Dreamweaver created:
    <param name="movie" value="/images/MyBanner.swf">
    However, when I reinsert the swf files, Dreamweaver creates:
    <param name="movie" value="../images/MyBanner.swf">
    I can change the references in the pages she created from '/' to '../' and the swf files work fine when loaded from my computer.  I have tested this in IE 8.0.6 and Firefox 3.6.2.
    Any ideas.

  • Relative References in formulas Hyp Fin Reporting

    How do I create a relative row reference with hfr functions, specifically text functions.  I know "cur" or "current" will give you the relative reference of the current row or column but am trying to figure out how to reference a row above.  Can I use "Cur -1" or something similar? 
    I am going line-by-line using text functions at the moment:
    Text Row Header
    <<MemberDescription(Current, 1, "Entity")>>
    <<MemberDescription(Current, 2, "Entity")>>
    <<MemberDescription(Current, 3, "Entity")>>
    <<MemberDescription(Current, 4, "Entity")>>
    etc...
    Many thanks in advance

    you can use IsMissing function to achieve the same. Just have a try, hopefully this should work.
    Regards,
    Rahul

  • How to remove related reference?

    Hello,
    I have two entity service: Incident and DispatchOffice.  Service "Incident" has relation to DispatchOffice service with name "dispatchOfficeRef" and cardinality 0..n. I want to delete one related object from this relation:
    String key = <incident_object_key>;
    String rel_key = <related_object_key>;
    AIncident inc = IncidentServiceProxy.read(key);
    bool result = inc.removeDispatchOfficeRef(DispatchOfficeServiceProxy.read(rel_key));
    inc.getAspect().sendChanges();
    During running this code I have no errors. After removeDispatchOfficeRef() call "result" variable has "true" value. But CAF doesn't anything: relation still exists.
    Permission check are disabled for both entity services.
    What I does wrong? Thanks for help.
    Best regards,
    Eugeny

    I found answer on my question.
    I created application service with following code:
    Incident inc = this.getIncidentService().read(incident_key);
    inc.removeDispatchOfficeRef(dispatch_off_key);
    this.getIncidentService().update(inc);
    It's works.
    CAF is very very strange thing.

  • Relative reference in condition of SUMIF

    I need to SUM all the weekly totals. Each row has a date. In a hidden table, I calculate the WEEKNUM of the entry. Using SUMIF, I can add everything up. However, it appears I have to hard code the condition. For example:
    =SUMIF(Table 5 :: A2:A37,"=30",Table 5 :: B2:B37)
    Is there some way I can avoid "=30" and use some kind of reference?
    A2:A37 is each entry's week number, B2:B37 is each entry's totals
    dt

    If the weeks are sequential, you can use ROW() plus an integer (ROW()+28 for instance if the formula was in row 2) to reference the week. You will also want to make the range absolute so instead of A2:A37 it would be A$2:A$37 or $A$2:$A$37 or you may be able to use a more simple A in place of the range which will reference the entire column. Same with the reference to B2:B37.
    You would end up with
    =SUMIF(Table 5 :: A, ROW()+28, Table 5 :: B)
    then fill down to the rows below, no changes required.

  • Changing Expressions reference from relative to absolute?

    Is there an automated way to change an Expression's relative references (e.g., thisComp / thisLayer) to more absolute references like Comp("MyComp25").layer("MyLayer10.mov")
    When I copy and paste layers that reference other layers into new comps, the expressions not surprisingly get invalidated since those layers do not exist in the new thisComp

    It's pretty straight forward, but it's not trivial. There may be something out there already that does this, but I'm not sure where. Basically, you need something that will drill down, recursively through all the properties in a layer, see if the property can accept an experssion, see if it has an expression, and then do a text replace on "thisComp". (It doesn't seem like you'd need to worry about "thisLayer"). There are examples out there on how to do the recursive part (which is where most of the work is).
    Dan

  • How to enter a relative path of flv

    We have a project with flv video embedded in one of the slides.  It works perfectly fine when we use absolute path to insert Flash video, e.g. (D:\Videolessons\communication\101.flv).  Now the client wants to deploy it in a media server and asks us to provide a relative path of the Flash video.  We tried something as follows:
    /communication/101.flv
    communication/101.flv
    /Videolessons/communications/101.flv
    Videolessons/communications/101.flv
    We put flv file in the "communication" folder. We then published the CP project to that folder as well.
    Unfortunately the published file doesn't contain the flash video any more.   The first two settings (/communication/101.flv and communication/101.flv) does not give error message, and the last two settings actually prompted the message that the Flash video cannot be loaded.
    What is the correct way of entering the relative path of the FLV file?  Thanks for your help.

    Skylineblue,
    Video is treated differently than other assets Captivate.  The path to the .flv file is NOT a runtime setting... which is really confusing.  The path that is entered for the .flv file should be relative to the SAVED PROJECT.  So, if your Captivate project file is located at D:\Videolessons\MyFile.cp and you have flash video files in D:\Videolessons\communication\101.flv, you could enter a relative reference like: "communication\101.flv"
    When you go to PUBLISH your captivate project, these .flv files will be MOVED to the publishing location.  So if you're publishing to C:\Publish, your .flv files would end up at C:\Publish\communication\101.flv.  FYI... after you publish, your video files will be moved... not copied, which can be a pain if you have to re-publish.
    HTH,
    Jim Leichliter

  • Is it possible to copy and paste a formula without changing the cell references?

    I am trying to paste a formula to a cell adjacent to where it currently is but when I do, the cell references in it change. I am trying to get exactly the same formula in the cell (without re-typing it).

    dedwards96 wrote:
    Just another quick question, is it possible to make a large number of cell references 'absolute'?
    Individual cell references in formulas may have four distinct states: relative, absolute column, absolute row, or absolute column and row. These are set using the popup menu on the reference itself. Click on the reference in the formula and choose one of the four states from the popup menu.
    Once set, you can fill the formula into the rest of a column or row using the Fill Handle (small circle at the lower right of a selected cell). Cell references in the new copies of the formula will remain absolute or adjst to their new position dependent on the setting for each reference. You can also copy and paste the cell (single click to select it, command-C to copy) with the same results.
    You can also copy/paste without changing the formula's cell references if you select the formula (Drag across the formula in the entry bar, copy, press tab to deselect and reconfirm the formula in the original cell) rather than the cell. Pasted into a new cell, the formula will appear as if you typed it in exactly as it was in the original cell—neither absolute references nor relative references will have changed.
    Regards,
    Barry

  • How to copy table from one sheet to another making formulas relative to current sheet

    I'm truly sorry if this has been answered within this forum but I've been reading these posts for the last hour and nothing. Ok so here's my issue:
    I'm trying to do a budget spreadsheet. My ss contains sheets with each one representing a month. So sheet 1 is called January, 2 February etc.
    I have two table in each sheet, one with a list of expenses and the other is a subtable with that references the first table for special expenses. The second table is identical in functionality in each sheet so I do a copy from January into February. However, when I copy into Feburary, all my formulas still point to 'January::' and I have to go and remove the 'January::' from each cell.
    Is there any way to copy the second table and make it relative to the sheet that it's in? It seems simple and maybe I'm doing something fundamentally wrong but I can't find the answer anywhere.

    I made a simple version of what I think you are describing:
    I gave each table a name "Tabl" and "SubTable"
    SubTable cell A1 is assigned as follows:
    A1=Table :: A1
    Then I duplicated the January Sheet by highlighting the sheet and typing the key command <COMMAND>+d (or selceting the menu item "Edit > Duplicate"):
    Then I change the name of the new shee from "January -1" to "February"
    The relative reference should already exist.
    You can confim this by changing the contants of the informaiton in cell A1 of Table in the "February sheet

  • Project File File References

    Does JDeveloper 9.0.4 use absolute or relative file references in its project (.jpr) files, or is it a mixture of the two? I've heard conflicting stories but have personally only ever seen relative references.

    Yes, I've tried this and have gotten a clean compile.  However, the .dll is associated with third party software intended to add controls to a form.  The form does not display in Designer though (extensive stack trace errors) which made me wonder
    whether there is a downside to this approach.

  • Nullpointer: Reference entity null

    Hey,
    I have an view (PremiebetalerView) that consists of 4 entities:
    - PolisRelatie (updatable)
    - Relatie (reference FK between PolisRelatie and Relatie)
    - Straat (reference FK between Relatie and Straat)
    - Beroep (reference FK between Relatie and Beroep)
    In the SQL I added an outer join: PolisRelatie.REE_REE_ID = Relatie.REE_ID (+).
    I have also a Car view and a view link between CarView and PremiebetalerView, with CarView the master.
    In java code I create a Premiebetaler view row instance and set some defaults of the PolisRelatie entity. When I select in other screen a Relatie I want to set this ID in the column REE_REE_ID of the polis relatie and refresh the relatie (row.getRelatie().refresh(PremiebetalerViewRowImpl.REFRESH_CONTAINEES)). This works well in my first CarView instance but when I copy this instance to a new view row and again create a Premiebetaler view row instance then row.getRelatie() evaluates to null so I can't refresh the entity.
    Why is this entity null and how can I 'initialise' this entity?
    Thanx, Marianne

    Workaround: update the reference entity manually.
    Create a custom ViewRowImpl (generate accessors) for the view, and for the foreign key attribute, use a setter that goes something like:
    public void setQuoteSheetId(Number value) {
      setAttributeInternal(QUOTESHEETID, value);
      // workaround ADF bug
      // if not equal
      if ((value != null) ? !value.equals(getpkQuoteSheetId()) : (getpkQuoteSheetId() != null)) {
        // find the correct entity and set it
        if (value != null) {
          ViewObject quoteSheetView = getApplicationModule().findViewObject("QuoteSheetView1");
          Key key = new Key(new Object[] { value });
          Row[] rows = quoteSheetView.findByKey(key, 1);
          if ((rows != null) && (rows.length == 1) && (rows[0] != null)) {
            ViewRowImpl viewRowImpl = (ViewRowImpl)rows[0];
            setEntity(4, viewRowImpl.getEntity(0));
          } else {
            throw new RowNotFoundException(false, quoteSheetView.getName(), key);
        } else {
          setEntity(4, null);
    }where
    getpkQuoteSheetId() is the getter for the primary key attribute of the reference entity,
    "QuoteSheetView1" is a default view of the reference entity,
    and 4 is the index of the reference entity for the view.

  • Calc: How can I get absolute cell references in tables to work?

    Hi, I'm new to Star Office, and have run into a problem in my first spreadsheet.
    I have a data table in my spreadsheet.
    Some cells in the table need to make calculations based on other cells in the table.
    When I sort the table, however, the cell references are made to be incorrect. I expected that I could just use absolute references (e.g. $A$2) and when the table was sorted those references would be updated to refer to the new absolute location of that cell, e.g. $A$10). However, the absolute references are being left literally the same ($A$2) after the sort, making them reference a different row of data than intended. Relative references of course don't work in this situation either (I tried for thoroughness). (I thought Excel behaved the way I expected, but I just tried it in Excel 2007 and it is exhibiting the same behavior as StarOffice Calc.)
    I'm also concerned, although I haven't tried it yet, about what will happen when I reference cells in this table from another table using absolute references that the same problem will exist...
    So basically, I can't find a way to use absolute references to cells in a table that will persist correctly when the table is sorted. Any suggestions?
    Thanks. Asa
    Edited by: earthasa on Sep 20, 2007 2:37 AM
    I was able to work around the problem by creating an index column in the table with a unique number for each row of data and using vlookup() to reference the correct row. If there is a more elegant solution I'm still interested :)
    Edited by: earthasa on Sep 20, 2007 3:00 AM

    OK. Think I've got it now thanks to looking at the short keys and searching for "Full Screen".  The upper left key is "`" which looks like a grave - a slightly angled single quote. But when I look at the "Application" setting for Toggle full screen it is set to "'" - a "normal" single quote.  Sure enough, if I hit the normal single quote key the toggle works.
    I have not been anywhere near the hotkeys and can't imagine why anything would change it from a grave key to a single quote - especially as they look almost identical on the screen.  I'm guessing that Adobe changed this (maybe only for international users?)
    Anyway I now know how to toggle full screen, although it makes the "Premiere" keyboard with its big purple key for "Toggle full screen" redundant.  Does make me wonder what the shortcut key of "'" or CTRL + "'" gives that I'm presumably missing since it appears to have been remapped.

  • [SOLVED] ADF BC : View Object "second level" Entity reference issue

    hi
    If I insert a row in a View Object that uses "two levels" of Entity references, the attributes of the Entity on the "second level" don't get a value.
    Consider these tables:
    MY_ROW (MY_ROW_ID, MY_ROW_STUFF, MY_ROW_LU1_ID)
    MY_ROW_LU1 (MY_ROW_LU1_ID, MY_ROW_LU1_STUFF, MY_ROW_LU1_LU1_ID)
    MY_ROW_LU1_LU1 (MY_ROW_LU1_LU1_ID, MY_ROW_LU1_LU1_STUFF)
    Where MY_ROW.MY_ROW_LU1_ID is a "look-up" in MY_ROW_LU1 and MY_ROW_LU1.MY_ROW_LU1_LU1_ID is a "second level look-up" in MY_ROW_LU1_LU1.
    I created default Entities and Associations on these tables and a View Object that uses all 3 Entities (MyRow as Updatable, MyRowLu1 and MyRowLu1Lu1 as Reference).
    See example code in
    http://verveja.footsteps.be/~verveja/files/oracle/ViewObjectEntityReferenceIssue-v0.03.zip
    (contains no Java code, all out-of-the-box ADF BC)
    problem scenario:
    If run the MyRowService Application Module in the Oracle Business Component Browser and "open" the MyRowViewAll View Object instance, I get the rows and their related "look-up values".
    If I click the "Insert a new record" button and fill out values for MyRowId, MyRowStuf and MyRowLu1IdEntity, I only get "look-up" values for the "first level". While the "second level" stays empty.
    For example, a MyRowLu1IdEntity of "2003" gives a MyRowLu1Stuff value of "2003 stuff", but no value in MyRowLu1Lu1Stuff.
    What am I doing wrong? What should I change to also get a value in the "second level" MyRowLu1Lu1Stuff attribute?
    many thanks
    Jan Vervecken

    Jan,
    If you create a view object on Emp and Dept, with Dept as a reference entity, you might choose to build the view object to only include the:
    Emp.Empno (required, since it's the PK of Emp entity usage)
    Emp.Ename (included since you want to show the ename)
    Dept.Deptno (required, since it's the PK of the Dept entity usage)
    Dept.Dname (included since you want to show the dname)
    The wizard enforces the inclusion of the required attributes above.
    When you run this view object, a join is performed and you see the reference data.
    Now, if you want to allow the user to UPDATE the reference data, you need to add one more attribute to the list of attributes:
    Emp.Empno
    Emp.Ename
    Emp.Deptno (To allow user to change Deptno employee belongs to)Dept.Deptno
    Dept.Dname
    At this point, not only is the join performed for you, but the ADF BC reference mechanism reacts to any modification of the Emp.Deptno attribute, correctly showing the reference information for that new foreign-key-referenced department (even before commiting and requerying, at which time the SQL join would pickup that correct, related information).
    The "second level" problem you describe in this thread is simply the same issue described here as a master/first-level-detail situation, taken to its logical next step. If you want the end-user to be able to change the second-level detail to which the first-level-detail is associated, you need to include the first-level-detail's foreign key attributes in the view object's select list. Otherwise, there is no foreign key attribute whose value-change event the framework can react to in order to coordinate the related reference data in the row.
    I've blogged a link to a working example of a four-level reference information view object here:
    http://radio.weblogs.com/0118231/2007/05/09.html#a818
    based on the HR schema.

  • How to "unchain" a cell reference?

    Hi!
    I try to do the following:
    The field A2 is linked to the upper table B2 to get the worth that is in it A3 to A4 are the same.
    The fields from C1 to E4 are linked to another table (not visible) by a query depending on the worth in B2.
    If i sort now the upper table by Rank the linked cells stay connected. But now A2 is connected to the upper B4. I understand that this is to maintain connections and make in many cases sense.
    In this case i need to "unchain" this. I simply want Numbers to look what is in the upper table in cell B2 regardless of sorting. I have tried with absolute and relative references but it doesn't work. 
    In OOCalc this is possible across tables.
    Can anyone give my a hint in wich way to look?
    Thanks
    A. Wolff

    HI Alexander,
    I would suggest looking at OFFSET, ROW() and COLUMN().
    INDEX might also be useful.
    Regards,
    Barry

  • How to "lock" a cell reference in Numbers??

    HELP! I am a recent convert from Windows based machines to Apple. I am very familiar with Excel and need to figure out how to do something in Numbers....
    I need to know how to lock a cell reference so that when you drag the formula down or across it keeps the same cell reference. In Excel you can do this by picking the cell and then hitting F4 to either lock the column, row or both.
    Anybody out there help a newbie?? Thanks

    Thanks Jerrold, I'm using them that way. My request has to do with
    using them as an Absolute Reference versus a relative reference.
    If I specify a header ref for a cell in a formula, when I drag that
    formula to some other cells I want Numbers to treat it as absolute,
    ie. as if I had said $A$5. What I am finding is that it does it's default
    behaviour, ie. it is translating the formula reference to a new cell just
    as it would do for a reference like A5.
    ie. with header references, what is the equivalent of specifying $A$5?
    ($header name doesn't work ).
    thx, rob

Maybe you are looking for

  • Can I remove files from "images removed from" dir?

    I have some duplicate files on my iMac, including some large videos in a "images removed from xxxxxxx" directory. Can I safely delete these?

  • GC installation on AIX machine

    Hi Guys, If any one has a good link or documents to install GC on AIX machine, Kindly forward it to me.

  • Upgrade FCS2 to FCS

    I'm about to upgrade my system from FCS2 to the FCS with the Final Cut Studio Upgrade package. Before the upgrade I will install Snow Leopard so it will be a clean install with all existing applications being reinstalled. Do I need to register my exi

  • How to monitor temp tablespace

    I server in 11gR2 and 10gR2. Is there a way to monitor its usage, like, who is using it, how much space a session is using, what are the objects crated, ie. temp tables. Thanks.

  • Question about speakers with a model num

    I have a Sound Blaster li've card model number: CT4780 Can this card play music thru 4. speaker set?