Image not displayed while running executable jar ?????

hello everyone...i have developed a game like mario and everything is happening well......
i have created an executable jar file of my game so that i can distribute it to my friends.............
now the problem is :
my all the images that are used in my game are in "Images folder", so when i run my executable jar file outside the reach of images folder than images does not get displayed on my game.................i mean when jar file is located beside my images folder then images get displayed but if i move my jar file to some other location then images doesn't get displayed.......
i have included images folder inside my executable jar file.....but same problem arises......
in my game, to display images i have used this code:
Image img=new ImageIcon("Images\\hero.gif").getImage();
so Images folder should be located at the same directory where my game is located....................
so can anyone tell me why this is happening ?
i want to execute jar file even if i relocate my jar file(i've put images folder inside jar).......
Edited by: JGarage on Nov 28, 2008 10:45 PM
Edited by: JGarage on Nov 29, 2008 12:50 AM

inside my jar , i have these three folders:
engine play res manifest.txt
engine and play are packages
to load an image i have used these code
Image img=new ImageIcon("res\\t.gif").getImage();
to draw image:
g2d.drawImage(img,x,y,this);
i had also used what u said :
img=ImageIO.read(Thread.currentThread().getContextClassLoader().getResourceAsStream(path));
Note: earlier u adviced me ImageIO.read(Thread.getContextClassLoader().getResourceAsStream("res/y.gif"));
getContextClassLoader() is not an static method so i can't acess it from static context.It gave me compilation error.so i used Thread.currentThread().getContextClassLoader().
and i haven't used BufferedImage.I have used Just Image.

Similar Messages

  • ICO file not displaying at run time?

    Hello Experts,
    I an using fusion 11.1.2.1 32 bit. I have Copied the Icons as well as GIF files in C:\Oracle\Middleware\Oracle_FRHome1\forms\java folder.
    At button property i set Iconic to yes
    and file = addrow
    Icon not display at run time.
    but when i set file = abc.GIF
    image is displaying at run time.
    My doubt is that ICO file not displaying at run time while GIF file are displaying.
    Do i need to change configuration ?
    Please do the needful.
    Thanks
    Yash

    Hi Yash,
    First Try this steps
    To resolve this issue, follow these steps:
    Double-click My Computer, and then click Options on the View menu.
    Verify that the Icon file type appears on the File Types tab. If the Icon file type does not appear in the Registered File Types box, skip to step 10.
    Click Icon in the Registered File Types box, and then click Edit.
    Verify that the following settings exist, and then click OK:
    The Description Of Type box contains Icon.
    If there is a Confirm Open After Download check box, it should be selected.
    If the settings do not appear exactly as listed in step 4, click Remove, click Yes, and then click OK. If the settings do appear as listed in step 4, skip to step 10.
    Click New Type.
    In the Description Of Type box, type Icon.
    In the Associated Extension box, type ICO.
    Click OK, and then click Close.
    Use Registry Editor to view theHKEY_CLASSES_ROOT\.icokey, and then verify that the default string contains the following value:icofileIf the .ico key does not exist, create it, and then insert the value listed above. If any other values exist in the .ico key, delete them.
    Use Registry Editor to view theHKEY_CLASSES_ROOT\icofilekey, and then verify that the default string contains the following value:iconIf the icofile key does not exist, create it, and then insert the value listed above. If any other values exist, delete them.
    Create a new key in the icofile key called DefaultIcon , and type %1 as this key's default value.
    Quit Registry Editor, and then restart your computer.
    Second Try this
    Simple way
    Copy your images to:
    1
    c:\Oracle\Middleware\as_1\forms\java\ 
    Notes:
    - Icon files may not be supported.
    - In case of a Java security issue when using gif images, you will need to create a jar file and sign it with oracles sign-tool (see below, point 6).
    - In case you having trouble with oracle’s sign-tool, do it directly with java’s
    Recommended way
    1. Create a “icons” folder and place all your gifs in there
    i.e. “c:\Oracle\Middleware\as_1\forms\java\<icons>”
    2. From within icons folder make a jar file of all the gif images:
    1
    jar -cvf frmicons.jar *.gif 
    3. Copy this new jar into “c:\Oracle\Middleware\as_1\forms\java\”
    4. Edit/update formsweb.cfg file:
    path = c:\Oracle\Middleware\user_projects\domains\<my_domain>\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.1\config\formsweb.cfg  …to update/include:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    # Forms applet parameter 
    codebase=/forms/java
    # Forms applet parameter
    imageBase=codebase
    # Forms applet archive setting for other clients (Sun Java Plugin...etc)
    archive=frmall.jar,frmicons.jar
    # Forms applet archive setting for JInitiator
    archive_jini=frmall_jinit.jar,frmicons.jar
    5. Edit/update Registry.dat file:
    path = c:\Oracle\Middleware\user_projects\domains\<my_domain>\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.1\config\forms\registry\oracle\forms\registry\Registry.dat
    1
    2
    default.icons.iconpath=icons/ 
    default.icons.iconextension=gif
    At this point your icons should work normally, but if you get a security check of Java for gif files then proceed to the next step to fix this. TIP: May need to restart the weblogic/forms server for changes to take effect.
    6. Sign your jar file with oracles sign_webutil.bat sign-tool.
    path = c:\Oracle\Middleware\asinst_1\bin\sign_webutil.bat
    Firstly, you need to edit the sign_webutil.bat as follows:
    1
    2
    3
    SET KEYSTORE_PASSWORD=my_password 
    SET JAR_KEY=webutil2 # will need to change for every run
    SET JAR_KEY_PASSWORD=my_password
    Secondly, set the environment path and finally run the command:
    1
    2
    3
    set path=c:\Oracle\Middleware\as_1\jdk\bin 
    cd c:\Oracle\Middleware\asinst_1\bin\
    sign_webutil c:\Oracle\Middleware\as_1\forms\java\my_icons.jar
    This will create your signed jar file. Once initialized from the web-app it should ask the user to “Trust” the certificate and never prompt again.
    Other issues you may encounter and may need to edit/update the following files/registry entries as well:
    formsweb.cfg
    path = c:\Oracle\Middleware\user_projects\domains\<my_domain>\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.1\config\formsweb.cfg
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    # Forms applet parameter 
    codebase=/forms/java
    # Forms applet parameter
    imageBase=codebase
    # Forms applet archive setting for other clients (Sun Java Plugin, ...etc)
    archive=frmall.jar, my_icons.jar
    ...or
    # Forms applet archive setting for JInitiator
    archive_jini=frmall_jinit.jar, my_icons.jar
    Registry.dat
    path = c:\Oracle\Middleware\user_projects\domains\<my_domain>\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.1\config\forms\registry\oracle\forms\registry\Registry.dat
    1
    2
    default.icons.iconpath=/forms/java 
    default.icons.iconextension=gif
    Registry entries:
    1
    2
    UI_ICON:<path_to_icons_dir> 
    UI_ICON_EXTENSION: "gif": ".gif" "ico": ".ico"
    Credits and further information can be tracked for icons issue here and for jar file creation here.
    Hope this will help.

  • CF slows down to a halt ... images not displaying

    My primary laptop on which I do all coding ...
    - less than 1 year old
    - Dell (cough) XPS M1730
    - Windows XP (latest)
    - ColdFusion Ver 8, developer edition.
    - No other issues with laptop
    Also running
    - SQL 2000
    - Synergy
    - Anti virus etc. changed Norton daily scan and unaware that I have picked up any viruses - I was my hands very well and often
    Over 6 months gradually CF has been slowly not display internal referenced <img src> tags.  External work fine.
    To the point now where most in our app do not display.
    Then in the past 3-4 days a lot of pages when called give Firefox or IE errors:
    Page will not display with too may users error.
    But there aren't any others.
    I go to all other web site, no issues with speed.
    I just cold warm booted the machine and now while page 1 appears, page 2, login, takes minutes to appear.  But on a beta server (also developer edition) it's instant.
    When I go straight into the browser, it works fine, albeit no images, crashes with a known bug (missing application variable), fix it, then resume, then just sits there forever.
    And there's no difference between the two machines ... well, not in "that" way.
    Adding to my confusion is ... I cannot get into the CF Admin panel.
    I can see it approve me, then it just spins.
    Nothing has changed on machine in past weeks EXCEPT traveling when I sign in to the usual plethora of wifi and other networks but never had a problem - except luggability
    I am thinking of, UGH, reinstalling Windows ... but why bother if it's working perfectly and only ColdFusion has an issue.
    Now COLD booted machine for 5 minutes.
    Everything seems better except CF still a BIT sluggish and still not "drawing" most images.  Able to access Admin panel.  Even if there images not displaying.
    Anyone any ideas?

    Thanks for your prompt reply ...
    We scoured for a folder like that and found none.
    What we DID find is that over the years of coding, we have a template count of 3,500 files in 130 folders, but the root where we start is about 1,500 files.   144 megs total size though.
    That shouldn't be too much?  Esp as our beta and production servers are using the same amount with no issues.
    Admittedly production is CF 7.X.
    Much more powerful machines but still.
    It would have made sense as that is the only thing on the machine that has "grown" ... but no luck.
    Does remind me of the day when our mail server got hacked and we had 100,000 outbound in the spool.  That was fun.: :)

  • Parameter Page Displays "Page Cannot Be Displayed" while running report

    Hi All,
    I have a report which take 4 hrs time to execute the report
    If i run this 4 hrs report,the report runs sucessfully when we see in particular
    report server in application server.
    But, we wont get any pop up to open report after executing sucessfully
    at user end, A error message is displayed in only report param page like,
    "The page cannot be displayed"
    I Think only param page is expired but not form session.
    We have also set the parameters like in report/conf/repsername.conf
    engineResponseTimeout=30 and <connection maxConnect="200" idleTimeOut="300">
    Also,In httpd.conf timeout is 3600 and MaxBlockTimeout in web.xml file
    we have set "maxBlockTime" for long running report (4h)
    <init-param>
    <param-name>maxBlockTime</param-name>
    <param-value>12600000</param-value>
    </init-param>
    Please help me out to solve this issue.
    Regards
    Nagaraj

    Parameter Page Displays "Page Cannot Be Displayed" while running report

  • CIN: Items are not displayed while updating the RG1 Register using T Code:

    Hi Experts,
    Items are not displayed while updating the RG1 Register using T Code: J1I5.
    System is not showing any error message.
    Can any one explain to update the RG1 Register?
    Thanks
    Chandra

    Hi,
    dont go the table again and again . the table is updated at intial stage only for stock update but not when SAP is running.
    In day to day bussiness the flow is as follows:
    Production - MB31 - to Unres stock
    Sales - VL02n - PGI - to customer - i.e out of unres stock
    Every day u can run TC J1i5 once in a day as decided and update the register so all transactions which have happend in that day gets updated i.e both input and output.
    and this will happen every day.
    hence dont use table as it is only for intial data upload i.e just before golive.
    Hope i am clear.
    krishna

  • OBIEE 10G Embedded Image not displayed on PDF

    Hi
    We have some embedded images (source on network share or on the webserver) on a dashboard. On the screen the images are displayed without problems.
    But if we want to print the dashboard (f.e. PDF) the images are not printed. In html-view the images would be displayed.
    Is there a known bug that images can't be printed on dashboard pages or do we have to embed them different?
    Thank you

    Hi Team,
    I do face the same issue of image not displayed in only pdf output format. Our client has deployed OBIEE 10.1.3.4.1 using Weblogic application server and is accesible through a secured url access.
    I have followed the fmap syntax to locate the image, also made sure the image is getting accessed through url, tried with different images of different sizes . In all cases the image display is appearing fine in HTML & Excel output. But not getting displayed only for pdf output.
    Can you please help me with this regard if am missing any specific setup for pdf output. Is there is any pointers or documentation available to get around this issue.
    Thanks in advance.

  • OBIEE 11G Embedded Image not displayed on PDF

    Hi
    I have some embedded images on a dashboard. On the screen the images are displayed without problems.
    But if we want to print the dashboard (f.e. PDF) the images are not printed. In html-view the images would be displayed.
    All the images are referenced with the fmap path.
    Any way to print the images in the pdf ?
    Thank you
    obiee 11.1.1.5
    O.S : Oracle Linux 5.6 x64

    Hi Team,
    I do face the same issue of image not displayed in only pdf output format. Our client has deployed OBIEE 10.1.3.4.1 using Weblogic application server and is accesible through a secured url access.
    I have followed the fmap syntax to locate the image, also made sure the image is getting accessed through url, tried with different images of different sizes . In all cases the image display is appearing fine in HTML & Excel output. But not getting displayed only for pdf output.
    Can you please help me with this regard if am missing any specific setup for pdf output. Is there is any pointers or documentation available to get around this issue.
    Thanks in advance.

  • JPG images not displayed correctly in Bridge and Photoshop (Mac OS)

    (Note: I have copied the content of this query from the Creative Suites forum where I originally opened it.)
    I am using CS4 under OSX 10.4.11 on a PowerMac G5 Quad with 23" Apple cinema display. Images which have been captured as JPG are displayed fine by Preview, but when opened in Bridge, Camera Raw or Photoshop. the colours are all "washed out". The attached screen capture should give an idea of the difference, with the upper being Camera Raw (image settings) and the lower being Preview. My monitor has been calibrated and I'm using sRGB IEC61966-2.1 colour space in Camera Raw and Photoshop. The colours displayed by Preview are pretty close to "real life". I find it virtually impossible to adjust the colours in Photoshop to get back to anything similar.
    After opening the image in Photoshop without adjustment, and Save As JPEG with embedded color profile, Preview displays the new image the same as Photoshop. Save As JPEG without embedded color profile, and Preview displays this copy just like the original. It seems that Photoshop is making different (incorrect) assumptions about what color space to use when there is no embedded color profile. Shouldn't it assume sRGB like virtually everything else (http://en.wikipedia.org/wiki/SRGB)? Or is its interpretation of sRGB incorrect? How can I fix this?
    Re: JPG images not displayed correctly in Bridge and Photoshop 

    xxxxyyyyz wrote:
    …If there is someone out there who has experience of obtaining decent colour management in CS4 on a Power PC, I would really like to know how you achieved it.
    That would be yours truly, and I hasten to reply because I may have some insights that can help you too.
    Just get it it out of the way, here's my setup:
    Photoshop 11.0.2 ("CS4"); VersionCue disabled and uninstalled.—2.5 GHz Power Mac (PPC) G5-Quad; 16GB RAM; mutant, flashed 550MHz nVidia GeForce 7800GTX 1,700MHz 512MB VRAM; ATTO ExpressPCI UL5D LP SCSI card; Mac OS X Tiger 10.4.11 and Leopard 10.5.8 boot drives; Spotblight, Dashboard and Time Machine permanently disabled; dual 22" CRT monitors; USB wireless 'n' available but connected to the Internet via wired Ethernet; 1 FW flatbed scanner; 2 SCSI scanners (one tabloid-size transparency scanner and a film scanner); various internal & external HDs; FW Epson 2200 and Ethernet Samsung ML-2850ND printers; 2 X Back-UPS RS 1500 XS units.
    I can unambiguously and in good faith represent to you that my color management, from capture to print, is as spot-on as anyone with any kind of setup can hope to achieve.  Unequivocally and without qualifications.
    Now, first things first:  Forget about trying to synchronize color management across the point applications lumped together only by Adobe marketing fiat into a variety of meaningless "creative suites".  Concentrate on Photoshop.  Do not try to use Bridge to synchronize anything.
    The "suites" are a totally artificial construct created by Adobe bean counters and marketing types.  The point applications (i.e. the individual programs clumsily bundled together, e.g. Photoshop, Illustrator, InDesign, etc.) are developed independently by separate engineering teams that are not only not in the same building, but in different cities, different states of the American Union, and even in different countries.  They have very little communication among them, if any, as evidenced by repeated posts in these forums by Photoshop engineering staff urging us, the end users, to let the other teams know in their own forums that a given problem exists and is actually affecting our work.
    Enough said about the cause of the problem.  The end result is that Color Management is at very, very different levels of progress and sophistication in each individual point application, with only Photoshop fully entitled to be considered state of the art.
    Secondly, a disclaimer:  I have been hanging on to my CRT monitors and take care of them as Jascha Heifetz used to take care of his Stradivarius.  I don't know what I will do if I manage to outlive the usefulness and accuracy of my CRTs (unlikely at this point).  I have despaired in futile efforts to bring the luminosity of any LCD monitor down to where I would feel comfortable calibrating and profiling it.  I believe my monitors are the foundation of my color management efforts.
    Especially if you have one of the extreme wide-gamut LCD or LED monitors, you'll face an uphill battle. 
    Be careful to avoid any version 4 icc profiles, whether canned or generated by your calibration software.  Stick to version2 icc profiles.  Ask the manufacturer of your calibration software/hardware if in doubt.
    Here are some not-too-recent, but thoroughly representative screen shots of the calibration results I obtain with my monitors, which I calibrate and profile often and regularly (I validate the calibration at least several times per month).
    In a nutshell, my color management practices and settings mirror those described by Bruce Fraser, Jeff Schewe, Andrew Rodney and Gary Ballard's site.  I have learned from all of them.
    My working color space is ProPhoto RGB.  I choose to work with PSD and PSB files.  As a long-time, rabid JPEG hater, I only rarely deal with JPEGs, using them sporadically to illustrate a point in this forum or elsewhere in the web.  My main output consists of prints.
    I only deal with tagged image files (files with an embedded color profile) and often recommend beating up with a baseball bat any moron that hands you an untagged file—figuratively of course, but I find the expression gets my point across unambiguously.
    Following is a screen shot of some of my pertinent settings:
    Note that I have never bought into the "suite" concept myself.  I do have and routinely use Adobe Illustrator 10.x, InDesign 2.x and Acrobat Professional 8.x, but they are all older, independent versions of each point application, licensed at different times.
    Be further advised, that the answer to many problems offered by Adobe engineers often is not to install VersionCue, or uninstall it, or at least disable it.
    Also, as outlined at the beginning of this post, concentrate on Photoshop, not on synchronizing applications that can't really communicate with each other, despite the claims of Adobe marketing hacks to the contrary.
    One big caveat, do not fall into this trap:
    xxxxyyyyz wrote:
    …I believe my problem has nothing to do with my monitor profile, for several reasons, but…
    …It seems extremely unlikely to me that…
    You either want to learn, or you don't.  You either want to solve your problems, or you don't.
    When you start arguing instead of studying, questioning advice instead of following it and detecting where you went wrong, you're on the right track to nowhere.  That attitude will get you there fast.  Remember you are the one with the problem, and only you can acquire the discipline to learn how to solve it.
    Go ahead and ask me anything that is not clear, just don't argue with me please, and don't tell me why you think Fraser, Rodney, Ballard and I are wrong.  You see, I am not experiencing any problem that needs fixing.  I have an interest in helping you, but not in hearing about your speculations, theories or conclusions.
    Good luck.
    Wo Tai Lao Le
    我太老了

  • Image not displaying in the Task Sequence Wizard. SCCM2012

    This is my question, so I will post the link here.
    http://community.spiceworks.com/topic/925727-image-not-displaying-in-the-task-sequence-wizard-sccm2012
    Bryan
    I captured an image from a PC that I am preparing to be deployed with Office 365. Once I captured
    the image, I went to the software library to add the operating system image. That seemed to go on without any issue, but when I look at the summary, I see the big yellow globe saying "in progress" it has not changed since yesterday afternoon.
    I then created the task sequence for this image
    to be deployed under Software Library, Task Sequences. When I selected the references tab, everything seemed to be in order with the exception of the "operating system image" under type. It was/is showing 0.0% Compliance.

    So, the problem described in the other forum post does not match the title of this thread. Are you trying to address two different things? These are unrelated btw.
    For the issue in the other thread, you'll have to troubleshoot your content distribution to the selected DP. The distmgr.log and pkgxfermgr.log (assuming you chose to distribute the image to a DP directly attached to your primary site) are the places to
    start and will show you exactly what's going on.
    As for the title of this thread, we'll need a lot more info to help you there.
    Finally, I would suggest you copy your questions from other sources into the thread -- this will help other folks in the future that may stumble upon this thread and will prevent any confusion.
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • RE: my input fields does not display when running the page

    my input fields does not display when running the page
    why is that so?

    Hi,
    Can you send the HTML code for us?
    Afonso

  • Total Amount value not displaying while executing print progrm for PO form.

    Hi All,
               I created the PO form, for this i written a print program.After executing this print program everything s displaying & populating, but only the Total Amount  not displaying r not populating.
              But, if i run the PO n tcode ME23N the Total Amount is displaying, after assigning the form n NACE.
    So help me to get the Total Amount to be displayed n main window, while executing the print program.
    Like this i declared n smartform,                    Total net value excl. tax           &is_ekko-waers& &is_pekko-netwr&......
    The print program as follows,
    report zpo.
    tables: ekko,pekko,ekpo,ekpa,eket,ekkn,ekek,komk,nast.
    data: fm_name type rs38l_fnam.
    data: is_ekko type standard table of ekko with header line.
    data: is_pekko type pekko occurs 0 with header line.
    data: it_ekpa like standard table of ekpa,
          it_ekpo like standard table of ekpo,
          it_pekpo like standard table of pekpo,
          it_eket like standard table of eket,
          it_tkomv like standard table of komv,
          it_ekkn like standard table of ekkn,
          it_ekek like standard table of ekek,
          it_komk like standard table of komk.
    selection-screen: begin of block b1 with frame title text-001.
      parameters: pr_ebeln like ekpo-ebeln obligatory.
    selection-screen: end of block b1.
    select * from ekpo into table it_ekpo where ebeln = pr_ebeln.
    select * from ekko into is_ekko where ebeln = pr_ebeln.
    endselect.

    code as follows,
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME                 = 'ZPURCHASE'
    *   VARIANT                  = ' '
    *   DIRECT_CALL              = ' '
    IMPORTING
        FM_NAME                  = fm_name
    CALL FUNCTION fm_name  "'/1BCDWB/SF00000060'
      EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
    *   CONTROL_PARAMETERS         =
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
    *   OUTPUT_OPTIONS             =
    *   USER_SETTINGS              = 'X'
        IS_EKKO                    = is_ekko
        IS_PEKKO                   = is_pekko
    *   IS_NAST                    =
    *   IV_FROM_MEM                =
    *   IV_DRUVO                   =
    * IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
    *   JOB_OUTPUT_INFO            =
    *   JOB_OUTPUT_OPTIONS         =
      TABLES
           it_ekpo                   = it_ekpo
           it_pekpo                  = it_pekpo
           it_ekkn                   = it_ekkn
           it_ekpa                   = it_ekpa
           it_ekek                   = it_ekek
           it_komk                   = it_komk
           it_eket                   = it_eket
           it_tkomv                  = it_tkomv.
    * EXCEPTIONS
    *   FORMATTING_ERROR           = 1
    *   INTERNAL_ERROR             = 2
    *   SEND_ERROR                 = 3
    *   USER_CANCELED              = 4
    *   OTHERS                     = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Image does not display while download with Java 1.6

    Hi,
    I have specified the following line in our jnlp file:
    <icon width="64" height="64" href="filename.jpg"/>
    Under Java 1.5, the image displays while the jar files are being downloaded, but under Java 1.6 they do not. Can anyone tell me why?
    Thanks.
    -Pete Spiro

    Is this a custom application that is viewing the report or is it Infoview or urlreporting?
    If it isn't a custom app, you may be better off posting this question [here|SAP BusinessObjects Web Intelligence; instead.  You may also want to open a case with support for this.

  • Console not display when run jar file

    i run jar file with command javaw -jar test.jar or double click on jar file, it's console app, it just run well but console not display, can i made console display and when i close console, it's stop jar file too?
    thanks

    i got it, javaw = no console window, i tried java command and i got error: can not access jar file?

  • Images Not Displaying in Program...

    I have my jar executable packaged along with all the images for my program packed into a .exe using jsmooth. The resulting executable works great and loads and displays images properly. I coded to use arguments so I can have the capability of using windows "open with" and defaulting my program to a filetype. When I open that filetype, the program works correctly, but the images are not displayed. I go back and execute the executable and there they are again, just not when I run it using arguments. Any reason why this behavior is happening? Any help is greatly appreciated! Thanks!

    The only place I can execute the program to get the images to load is the desktop. Even if I go back into jsmooth and rebuild it to put the executable in another directory, it still doesn't load the images. Only when it's moved to the desktop does it display the images...
    Is there a way I can put images into my jar executable or have them more locally available to my program? Can I link them in from the net?

  • Images not displaying.

    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.awt.geom.*;
    public class Game extends Applet implements Runnable, KeyListener {
         protected Thread thread, animation;
         private int i, keyVal, width, height, firstIndex, cellWidth, cellHeight, cellBorder;
        private double x, y, px, py, dx, dy, ddx, ddy, rate;
         private Image offscreenImage, background, images[];
         private BufferedImage redGuy;   //Create grafix objects to handle back buffering
           private BufferedImage[] drawingImage;
         private Graphics offscr;
        private boolean upPressed, downPressed, leftPressed, rightPressed, spacePressed;      //Keypressed variables
         public Game() { //Constructor (initalizes variables)
              thread = new Thread(this);  //Initalize thread, as new instance of our applet
              i = 0;           // Initalize our loop counter to 0
            x = 1;        // Initalize x coordinate to 1
            y = 1;        // Initalize y coordinate to 1
            px = 0;          // the previous x position    
              py = 0;      // the previous y position
              dx = 0;      // the change of x (delta x) -- speed of x
              dy = 0;      // the change of y (delta y) -- speed of y
              ddx = 10;     // the change of dx (delta delta x) -- acceleration of x
              ddy = 10;     // the change of dy (delta delta y) -- acceleration of y
              rate = 1000 / 30;  //Rate at which we'll make our thread sleep
                                  //the thread sleeping will give us our FPS                         
            //Initalize my keydown variables
            upPressed = false;
            downPressed = false;
            leftPressed = false;
            rightPressed = false;
            spacePressed = false;
            //Initialize array
            drawingImage =  new BufferedImage[7];
         public Image[] loadImageStrip(String filename,  int numImages, int cellWidth, int cellHeight, int cellBorder)
              Image [] images = new Image[numImages];
              MediaTracker mt = new MediaTracker(this);
              Image img = getImage(getDocumentBase(), filename);
              mt.addImage(img, 0);
              try {
                   mt.waitForID(0);
              } catch (InterruptedException ex) { /* Do nothing */ }
              int numCols = 1;//img.getWidth(this) / cellWidth;
              ImageProducer sourceProducer = img.getSource();
              for(int i = 0; i < numImages; i++) {
              images[i] = loadCell(sourceProducer ,((i%numCols) * cellWidth)+cellBorder,
              ((i/numCols) * cellHeight)+cellBorder,
              cellWidth - cellBorder,
              cellHeight - cellBorder);
              return images;
         public Image loadCell(ImageProducer ip, int x, int y, int width, int height) {
              return createImage(new FilteredImageSource(ip, new CropImageFilter(x, y, width, height)));
         public void init() {          //Equivalent of the Main method
              thread.start();          //Start the thread
           background = getImage(getDocumentBase(), "castle.jpg");
         addKeyListener(this);   //Makes our applet listen for pressed keys!
         //Create back buffer for page flipping
         width = getSize().width;          //Set width variable to size of screen
           height = getSize().height;          //Set height variable to size of screen
           offscreenImage = createImage(width, height);     //Create off screen image (back buffer)
           offscr = offscreenImage.getGraphics();
           //Put this next line here so that it only gets drawn once.
           offscr.setColor(Color.black);
           offscr.fillRect(0,0, width, height);     //Draw black background rect.
           images = loadImageStrip("stick_low_punch.bmp", 5, 60, 300, 3);
         public void run() {     //This method is where we will handle our main game loop
              //Infinte loop (to refresh our screen and handle game stuff)
        while(true)
             px = x;          //Sets previous x
              py = y;          //Sets previous y
          i++;     //Increments I (so we can see how many times this loop has ran)
          processKeyPressedEvents();  //Processes any key events that've happened
          processKeyReleasedEvents();
          detectCollide();     //Runs our detect collision code
          repaint();          //Repaints the screen to update stuff.
          try {               
            thread.sleep((int)rate);          //Tells the thread to shut down for 33 milliseconds
                 } catch (InterruptedException e) { }
      //Paint method.  Paints everything to the applet for us.
           public void paint(Graphics g)
                offscr.setColor(Color.black);     //Set Color to black
                offscr.drawImage(background, 0, 0, this);
            offscr.drawString("i = "+i,10,20);  //Shows value of i at Location 10, 20
            offscr.drawString("Key = " + keyVal, 70, 20);   //Draw key value
            for(int q = 0; q < images.length; q++) {
                   offscr.drawImage(images[q], (int)x, (int)y , this);
                   offscr.drawString("Q = " + q, 70, 40);
                g.drawImage(offscreenImage, 0, 0, this);
           public void update(Graphics g)
             paint(g);
         public void keyPressed(KeyEvent e) {
              keyVal = e.getKeyCode();
              switch(keyVal) {
                   case KeyEvent.VK_UP : upPressed = true;
                   break;
                   case KeyEvent.VK_DOWN : downPressed = true;
                   break;
                   case KeyEvent.VK_LEFT : leftPressed = true;
                   break;
                   case KeyEvent.VK_RIGHT : rightPressed = true;
                   break;
         public void keyReleased(KeyEvent e) {
              keyVal = e.getKeyCode();
              switch(keyVal) {
                   case KeyEvent.VK_UP : upPressed = false;
                   break;
                   case KeyEvent.VK_DOWN : downPressed = false;  
                   break;
                   case KeyEvent.VK_LEFT : leftPressed = false;   
                   break;
                   case KeyEvent.VK_RIGHT : rightPressed = false;
                   break;
         public void keyTyped(KeyEvent e) {
         //I don't need this method for now.     
           public void detectCollide() {
          /*  Collision detection for borders of window */
          if(x <=0) { x = 1;}       //Detect x at left
          if(y <=0) { y = 1;}       //Detect y at top
          if(x >=getSize().width-50) { x = getSize().width-50;}   //Detect x at right
          if(y >=getSize().height-180) { y = getSize().height-180;}   //Detect y at bottom
         public void processKeyPressedEvents() {      //This will handle the events if a key is pressed.
          /* This is an IMPORTANT method.
           *not only does it make for smoother movement
           *but it also allows us to press and
           *hold multiple keys.  Without this
           *method, holding a key down would
           *be interrupted by the next key pressed
          if(upPressed == true) {
           y -= ddy;  dy -= ddy;
          if(downPressed == true) {
                y+= ddy; dy += ddy;
          if(leftPressed == true) {
                x-= ddx; dx -= ddx;
          if(rightPressed == true) {
                x+= ddx; dx += ddx;
      public void processKeyReleasedEvents() {
           if(upPressed == false) {while(dx < 0) {dy += ddy; }}
          if(downPressed == false) {while(dy > 0) {dy -= ddy; }}
          if(leftPressed == false) {while(dx < 0) {dx += ddx; }}
          if(rightPressed == false) { while(dx > 0) {dx -= ddx; }}
    }For some reason my image (the strip image) is not displaying. It's loading, but nothing is being shown.
    If anyone can figure out why, please let me know, I've been beating my head off the wall for about 2 weeks now.
    Thanks,
    Brian

    I noticed in your code you are trying to load a bitmap image. I don't think Java is capable of using that
    image format yet.. Stick to using .jpg , .gif, .png

Maybe you are looking for

  • Error while posting SOAP request

    Hi All,    I am working on one SOAP to RFC syncronous scenario, when i am checking the scenario using XML spy i am getting following error, Please help me <?xml version="1.0"?> <!-- see the documentation --> <SOAP:Envelope xmlns:SOAP="http://schemas.

  • How to create a string array?

    Thanks!

  • Has anyone else noticed how slow iTunes has been to browse music previews?

    This has been going on for a handfull of days so far. Kind of reminds me of the after Christmas rush of 06. Does anyone think that this has anything to do with the iPhone factor and an overload of new customers for the servers to deal with? I would l

  • SMS in Japan

    I am having problem in sending text SMS to Japan mobile phone while I am in Japan. I have tried to send a message to my own Singapore registered phone number and it is working well. Anyone out there can help me? The phone number which I do like to se

  • Scroll for an af:iterator component

    Hi, I have an af:iterator into an af:menu component with the rows attribute set to -1. How can i display the af:iterator list into a scrollable component with a fixed height? By default the component displays all its items and introduces a vertical s