Applet not displaying images

i have created a class which extends an abstract class that extends applet, and this class fails to show images when i use the graphics.drawImage command in paint.
note: i am using appletviewer
package hangman;
public abstract class Hangman extends Applet
       implements KeyListener
package christmas;
public class Christmas extends hangman.Hangman
   private Image[]   noosePosition;   
   private Image     escape;
   private int            index;
   public void init()
      noosePosition = new Image[11];
      for (int i = 0; i < noosePosition.length; i++)
       noosePosition[i] = getImage(getCodeBase(), "images/noose" + i + ".bmp");
      escape    = getImage(getCodeBase(), "images/escape.bmp");
      index     = 0;
    public void paint(Graphics g)
       int x = 40;
      switch (index)
          case -1: g.drawImage(escape, 150, x, 50, 100, this); break;
          default: g.drawImage(noosePosition[index], 150, x, 50, 100, this);
                        break;
}upon winning the index is changed to -1 and each wrong guess increments the index by 1. I know that the paint command is called because other code in the paint method is executed. everything else works in the program and it produces no errors.
the directories are as such:
my stuff (base directory)
  hangman (folder)
     Hangman.class
     [two inner classes of hangman]
  jdk profiles (folder)
  christmas (folder)
      Christmas.class
  Hangman.java
  Christmas.java
  images (folder)
      [all bitmap images referred to in code]
  Christmas.htmlthe html file is as such:
<HTML>
<HEAD>
<TITLE>A Christmas Program</TITLE>
</HEAD>
<BODY>
You may need to give authorization to run java applet.
<APPLET CODE="christmas\Christmas.class" WIDTH=500 HEIGHT=500>
</APPLET>
</BODY>
</HTML>

to
<APPLET CODE="christmas.Christmas" WIDTH=500
HEIGHT=500>
I think it won't work because of parameter CODE. The browser or Appletviewer can just think that it's a file "christmas" with a Christmas-extension.
Any case, my applets work in a such way:
<APPLET CODEBASE="christmas" CODE="Christmas" WIDTH=500 HEIGHT=500>
Message was edited by:
stopper

Similar Messages

  • Signed applet not displaying images in plug-in

    I have an application/applet that (among other things) displays a toolbar containing buttons with images. The images (GIF files) reside in a subfolder (Images) beneath the folder containing my classes. This runs correctly when run as a standalone application and as an applet within appletviewer. I packaged it into a Jar file (including the images), and again I was able to run it as a standalone application and within appletviewer. I signed the jar file, and again it runs correctly both standalone and in appletviewer. But, when I attempt to run it from my browser (IE 5.5), using the Java plug-in (1.3.1), the toolbar displays without the images; it's as if the images can't be found in the Jar file. Is there any reason why running the Jar file within the browser would have this effect? I would assume that this has something to do with the plug-in, since in all other cases (not using the plug-in) the applet ran correctly.
    Thanks for any information,
    Carl Rapson

    Okay... let me add a little bit to this discussion:
    I was having a very similar problem.
    I have a JInternalFrame that needs to display multiple images simultaneously. The images HAD to be stored in a compressed .jar file because I'm working in an embedded environment, so space is at a premium.
    It always worked perfectly when run in the appletviewer. In a browser the results were unpredictable. Occasionally all the images would display right away. Sometimes they would all come up, but it would take absolutely forever. Sometimes only the first image would display. And, of course, sometimes none of them would.
    For anyone who cares, I'm using the 1.5 Update 7 JRE.
    What I finally had to do in order to get the images to load consistantly in a browser environment, was to load each image in it's own thread.
    Here's the code for anyone who might need it:
            try {
                java.awt.EventQueue.invokeAndWait( new Runnable() {
                    public void run() {
                        m_IMG1 = new ImageIcon( getClass().getResource("/Main/Images/img1.jpg") );
                java.awt.EventQueue.invokeAndWait( new Runnable() {
                    public void run() {
                        m_IMG2= new ImageIcon( getClass().getResource("/Main/Images/img2.jpg") );
                java.awt.EventQueue.invokeAndWait( new Runnable() {
                    public void run() {
                        m_IMG3 = new ImageIcon( getClass().getResource("/Main/Images/img3.jpg") );
            } catch (InvocationTargetException ex) {
                ex.printStackTrace();
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            }

  • HT1553 I restored my hard drive from time machine. Why is iPhoto not displaying images properly?

    I restored my hard drive from time machine after power blinks corrupted the file system so badly that disk utility could not repair it. Since then, iPhoto has not displayed images correctly. Events are there, and blank squares are shown, but that's all. I rebuilt small and all thumbnails and permissions -- I think the top three or four options in the iPhoto rebuild utility, which took five hours to do but which seems not to have changed anything. The iPhoto library is still more than 100GB, so the photos are there. I didn't choose rebuild from backed up --- whatever the final option on the rebuild menu offers -- because that seems to be appropriate only when a backup is interrupted. Could certainly do it, though. How do I get iphoto behaving again? I have full time machine backups saved automatically and another fairly recent copy on a separate hard drive stored remotely. Thanks for whatever help anyone can provide. I've looked at existing questions and solutions without success so far.

    What version of iPhoto and system are your running?  Since you've tried rebuilding with iPhoto give this a try:
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    Download iPhoto Library Manager and launch.
    Click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option
    In the next  window name the new library and select the location you want it to be placed.
    Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments. However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    If you have an external HD you might want to have the rebuilt copy created on it unless you have well more than 100 GB available on your boot drive.
    OT

  • Latest flash version will not display images or video

    Latest flash version will not display images or video in 2 x Windows 7 Pro 64bit machines, 1 x Windows 7 Home Premiums, and 1 x XP SP3 under VMWare Workstation 7. Problem plagues Firefox, Chrome, and IE on all systems. Also running Norton Security from Comcast on all machines. Disabling does not appear to help. Suggestions?

    Not sure, this is the one that I really want to view. I am using the latest 11.6 ending in 168. Curious you got the images. The product ones act like they should be displaying for me but don’t. Can you do a capture of the images? The text with small images sometimes comes through and sometimes not. I wonder if there is a problem on the server end.
    When I talk to the Customer Service people they claim to have no reports of problems, but like the sports pro about to be traded, they may be the last ones to know…

  • Mail will not display images with .jpeg extension. .jpg works fine. (displays in place when opening the email. What plug-in would correct this?

    Mail will not display images with .jpeg extension. .jpg works fine. (displays in place when opening the email. What plug-in would correct this?

    If you think you're insane now, try maintaining those pop up menus.
    As far as I know, these menus have not been updated since FW 8, so 
    they are at least two versions old.
    Save yourself a lot of grief by avoiding those menus. There are many 
    other products on the market which do a much better job of creating 
    and maintaining this type of navigation structure.
    Read this link before you climb any higher on this slippery slope:
    http://apptools.com/rants/jsmenu.php
    There was another blog post by the fellow who originally wrote the pop 
    up menu feature, but I can't seem to locate it. Even he says stay away 
    from them.
    Not the answer you probably want, but I hope it helps, nonetheless.
    Jim Babbage

  • Mail 7.3 (1878.6) not displaying images in random messages.

    In the last couple of weeks, I've noticed that, with no preference changes made by me, that random messages are not displaying images only empty boxes with the small blue question-mark box in the middle. This is almost exclusively from companies and organizations that I'm interested in.
    I've made no changes with regard to messages downloading with my mail in Mail's preferences. If I had, I'd think that ALL such messages would behave the same.

    Nothing happens. Loading remote content is a Mail preference for me for everything. Best I can do is choose to click the "if your having trouble seeing this..." offered by many advertisers to take you to their site.
    Since it's random, I wonder if it's not something that has to do with those specific servers sending those messages. And it's only a few, but enough to be annoying. These are people I've received perfect content from for years in some cases. No changes have been made to my preferences.

  • Safari on my account does not display images when you open a picture.

    I have Snow Leopard 10.6.8 installed. Safari on my account does not display images most of the time when you open a picture like (www.example.com/example/example.jpg or any other format). If the image does not display, I can drag from the corner, it displays the image. However, pdf does not work at all. I have to choose open in Preview to view the pdf file. I can even show the example:
    Sometimes the images work like right now.
    2. This is the time when the images do not work.

    Hi all the real problem was this...
    The issue was that the wee rubber eye piece around the viewfinder had slipped out of its seat slightly and was covering the sensor for the LCD. I Just checked the rubber eye piece bit  pushed right down till it clipped into place and now not obstructing the LCD sensor as the picture displays both with the LCD auto off enabled or disabled !! simple thing but a massive trap !

  • Mail not displaying images

    Hi...
    I have a strange new problem with Mail. It is not displaying images in email newsletters that I receive, but just from one sender. This has only been the case for a couple of days. I actually make the email newsletter and send it out from a web-based program but I obviously send it to myself to test how it looks etc. There was a problem recently with the server that meant that the email newsletter did not display images (just a box with a ? inside) for most recipients but it always appeared fine to me. Now it's the other way around. All other recipients seem to be able to view the newsletters fine (including other Mac and Mail users) but not me!! I do not have any other problems with Mail except for the occasional crash. Any ideas please??
    Thanks....

    Is this helpful?
    I think so, it indicates to me that they have problems!
    This is why the hosting company say it must be a problem with my mail program only.
    Might be, but even different Macs on the same Network may have or get different DNS numbers, and the question mark means either an unknown Pic type,or the link to where it's stored isn't getting through.
    Might try putting these numbers in Network>TCP/IP>DNS Servers...
    208.67.222.222
    208.67.220.220
    They'll be slower since they're in the US, but interest to see if the Pic shows, or can be opened/downloaded then... you can erase them afterwaeds, or put yors back.

  • JSP pages not displaying images in Jdeveloper

    HI
    I am using lot of images in the JSP page.But the JSP pages are not displaying images in Jdeveloper in Design preview.
    Do I need to install Apache for that?I have not installed Apache yet.
    If so then what are the configuration or settings I have to do in Jdeveloper for Apache.
    Thanks in Advance.
    Apps user

    Which JDeveloper version? where are the images stored? can you share the code you are using to show such an image?
    Try this - create a JSP page and drag an image from your desktop onto the JSP page - this will add the image to your project - does this work?

  • How can I make Firefox not-display images?

    About 20 years ago I could configure Mosaic to not-display images. I browse with lynx usually now, but have to use something else when I need Javascript. Sometimes I want to not-display images. I can't find a setting in Firefox for this.

    Note that you can control this via the <b>permissions.default.image</b> pref on the <b>about:config</b>
    The default is 1 to allow all images, a value of 2 will block images.
    *http://kb.mozillazine.org/permissions.default.image
    **1: Allow all images to load, regardless of origin. (Default)
    **2: Block all images from loading.
    **3: Prevent third-party images from loading.

  • The safari software will not display images (pictures).  I have done the "reset" but still no help.  What should i try next?

    the safari software will not display images (pictures).  I have done the "reset" but still no help.  What should i try next?

        Safari > Preference > Advanced
        Checkmark the box for "Show Develop menu in menu bar".
        "Develop" menu will appear in the Safari menu bar.
        Click Develop and make sure that"Disable Images" is not enabled in the dropdown.

  • Lightroom 2.1 will not display images.

    I use previous versions of Lightroom 1.3, 1.4, 2 Beta and they work fine. Now I upgraded to Lightroom 2.1 and Masters Collection CS4 and Lightroom 2.1 will not display images. All the images I import are just a shade of gray.
    When I adjust the parameters of the image the histogram is changing but the image is blank.
    I have a Vista machine.
    Thank you

    I have a Vista Home Premium, I am on Vista X86 and I just installed LR 1.4 and is working. Also LR2 Beta was working.
    So on the same Vista X86 machine LR 1.4 is working LR 2.1 is not displaying the images.
    This is the sysinfo:
    Lightroom version: 2.1 [512205]
    Operating system: Windows Vista Home Edition Service Pack 1 (Build 6001)
    Version: 6.0 [6001]
    Application architecture: x86
    System architecture: x86
    Physical processor count: 4
    Processor speed: 2.4 GHz
    Built-in memory: 3069.7 MB
    Real memory available to Lightroom: 716.8 MB
    Real memory used by Lightroom: 99.9 MB (13.9%)
    Virtual memory used by Lightroom: 75.2 MB
    Memory cache size: 65.9 MB
    Serial Number: 116040017170941123477699
    Application folder: C:\Program Files\Adobe\Adobe Photoshop Lightroom 2
    Library Path: C:\Users\Alex\Pictures\Lightroom\Lightroom 2 Catalog.lrcat

  • OBIEE not displaying images for Dashboards of one subject area

    Hi All,
    I have 5 subject areas and lot of dashboards created for all of them.
    For dashboards of one subject area, OBIEE is not displaying images but it is working fine for dashboards of other subject areas.
    Does anyone has any idea about this issue.
    Note: OBIEE is installed on UNIX for my system.
    Please let me know anyone need any other information from my side.
    One more thing : How can I attach a document to this thread.
    Regards,
    Vikas
    Edited by: Vikas Barsaiyan on 25-Apr-2011 00:00

    Hi,
    U have create new Catalog and deploy that via EM then can see u r latest new catalog. u r telling u have created new RPD and deployed only but u didn't change it default catalog (sampleapplte) so create new catalog deploy it.
    refer below one to create new catalog
    http://obieeelegant.blogspot.com/2012/02/how-to-create-new-catalog-in-obiee11g.html
    Thanks
    Deva

  • PDFs not displaying images when opened in Google Chrome.

    My PDFs are not displaying images when opened in Chrome. They do display in other browsers and when saved to the desktop. I have tested on multiple machines. Is there a problem with how they are saved? Here is a test: http://www.omnils.com/userfiles/files/Brochures/KL-003_REV_0914_APEX_CR_SPEC_SHEET_lo.pdf

    "... a known Chrome issue."  The resolution lies with Google for this - nothing you can do (other than disable the "in house" browser add-on and enable Adobe's (if you have Reader or Acrobat installed)).
    A similar issue exists with other, contemporary, browser releases.
    The "fix" is these software houses to deploy PDF viewer browser add-ons that actually comply with ISO 32000.
    Perhaps their lazy approach reflects the attitude of "Hey, Adobe will get the hit not us."
    Provide your users a feed-back mechanism; you'd be able to respond with the suggestion that they ping on the appropriate software houses to provide adequate software.
    Be well...

  • Safari Version 6.0.5 (8536.30.1) is not displaying images.

    Is anyone else having problems with Safari not displaying images on webpages?

    Never mind. This was my own fault. I had been debugging with the developer menu and had disabled images. Sorry for the spam!

Maybe you are looking for

  • ITunes 10.6.3.25 on PC running Windows 7 (service pack 1 installed)- music progress bar not moving

    Unable to play music from ITunes library or audio cd.  The sound card works, speakers work when tested with audio device.  Audio drivers updated, not sure where to turn.  Have seen similar threads in the recent past.  What needs to happen here.  Any

  • Shared photo streams not transferring photos

    My shared photo stream was working fine, and then suddenly it wouldn't receive any photos from other users, and wouldn't send them my uploaded pictures? How do i get it to work again? I also got an email that someone subscribed but it never showed up

  • Can't import mail/address book from Outlook, old drive, old OS

    Recently my wife's G4 died and we bought another. We transferred my wife's the old drive which was running OS9 (I know, she was just hard to convert)and added it to the new G4 as a secondary drive and also as a means of transferring the data. She ws

  • Pending Approval Queue

    Hi, I am getting the following error when I want to see the approvals pending for a user. Error: ERROR,02 Apr 2009 15:39:19,964,[XELLERATE.WEBAPP],Class/Method: tcActionBase/execute encounter some problems: {1} java.lang.NullPointerException at com.t

  • MobileMe iCal synch no longer a preference

    I just looked at my iCal on my MacAir to find a meeting I set up using my iPhone.  It wasn't there!  I logged on to MobileMe and there it was.  So the iPhone and MobileMe sync but not my MacAir anymore - how useful is that - NOT! I know MobileMe is g