Loading Images in CrEme JVM

Hi all,
I'm trying to load images on an HP iPAQ using the CrEme JVM for Windows CE 4.1. I'm using the awt Toolkit getImage() method with a MediaTracker. Everything runs fine on the desktop, but CrEme won't render any images. Here's my code:
package ImageTest;
import java.awt.*;
import java.io.*;
public class ImageTest extends Frame
     Image m_Image;
     public ImageTest()
          setVisible(true);
          setSize(Toolkit.getDefaultToolkit().getScreenSize());
          setTitle("Image Test");
          try
               MediaTracker mt = new MediaTracker(this);
               m_Image = Toolkit.getDefaultToolkit().getImage("filename.gif");
               mt.addImage(m_Image, 0);
               mt.waitForAll();
               System.out.println("Image dimensions: " + m_Image.getWidth(null) + ", " + m_Image.getHeight(null));
               paintComponent(this.getGraphics());
          catch(Exception e)
               e.printStackTrace();
     public void paintComponent(Graphics g)
          g.drawImage(m_Image, 0, 0, null);
     public static void main(String[] args)
          ImageTest test = new ImageTest();
}If anyone knows any method of loading images in CrEme, I would greatly appreciate it.
Thanks.

I have the same problem using Creme. I would really very grateful if you could help me...
package src;
          import java.awt.*;
          import java.awt.image.BufferedImage;
          import javax.swing.*;
          public class MapPanel extends JPanel {
               Image image;
               BufferedImage mBufferedImage;
               int width = this.width;
               int height = this.height;
               static String path = "/resources/Forum.jpg";
               public MapPanel()
                    loadImage(path);
               createBufferedImage();
               public void loadImage(String fileName)
               try
                    image = Toolkit.getDefaultToolkit().getImage(fileName);
                    MediaTracker mt = new MediaTracker(this);
                    mt.addImage(image, 0);
                    mt.waitForAll();
               catch(InterruptedException ie)
                    ie.printStackTrace();
               return;
               public void createBufferedImage()
               mBufferedImage = new BufferedImage(image.getWidth(this),
               image.getHeight(this),
               BufferedImage.TYPE_INT_RGB);
               Graphics2D g2 = mBufferedImage.createGraphics();
               g2.drawImage(image, 0, 0, this);
               g2.dispose();
               public void paintComponent(Graphics g)
                    super.paintComponent(g);
               g.drawImage(image, 0, 0, this);
          }

Similar Messages

  • Problem loading images in my applet

    Hi guys,
    When i test my Applet using an IDE the images are loaded fine, however when I run my applet using a browser it wont load the images.
    I think it is because I use this line:
    System.getProperty("java.class.path",".")My question is, how do you load images into an applet without signing it.
    Any help would be great.
    Alex

    Axilliary files like images, properties files etc. which are essentially part of the program are refered to as "resources". The best way to access these files is by the getResource() methods in the Class or ClassLoader objects. If you do it that way then the JVM reads them exactly the same way it reads .class and from the same place.
    Say your using an image, say my.gif from a class called MyClass. You put the image file in the same directory as the MyClass.class file. Then, in MyClass, you do:
    static ImageIcon myImage = new ImageIcon(MyClass.class.getResource("my.gif"), "MY Image");That will pick up the image from a file, from an http connection, from a jar, of from any combination of same.

  • If I set Firefox to refrain from loading images automatically, how can I view a single image, or a single page's images, without having to enter the site in the Exceptions list, only to go back and remove it when I'm done?

    I was hoping for a hotkey option or button on the toolbar to load images for a single page for a single session at a time. Turning off images really saves bandwidth and speeds load time on websites, but sometimes I'd like to view the images on a page, but only for this session. Is that possible, or do I have to go to the Exceptions page and allow a specific domain or page to load images and then go back and remove that domain or page when I'm done?

    *Image Block: https://addons.mozilla.org/firefox/addon/image-block/

  • Using Firefox to access facebook chat Button or online friiend chat button generates a Black screen with CANNOT LOAD IMAGES and no chat window opens.

    This does not happen in other browsers and it happens on a variety of computers I have access to and would seem to be a common problem but I can find no identical cases in my searches of
    Firefox , Facebook or windows help or Google search. My home machine is only a P2 with WINXPCORP but works fine and I have done all updates but still have this continuing problem every time I try to use Firefox
    to access Facebook chat but it does not happen with IE or chrome
    The response to clicking on chat button or friend chat is a black screen with small center square box with blue title bar that says
    '' VIEW IMAGE FULL SCREEN - (42) FACEBOOK X""
    center of box is ""! "" mark in yellow triangle and wording
    "" CANNOT LOAD IMAGES ''' OK
    clicking on OK returns to facebook page but no chat opens.
    Some times |VERY RARLEY if as the page loades you click on
    chat button with 1/2 second of it appearing chat will open.

    Hi,
    Please also see [https://support.mozilla.org/en-US/kb/Problems%20using%20Facebook%20in%20Firefox this.]

  • Why won't safari load images and connect to websites?

    We've had this problem intermittently for several months. When visiting SOME websites (though never the same ones twice) instead of loading images, it comes up with a blue question mark in a box. if we try to reload the page, it will do one of two things: it will either reload exactly the same, or, it will reload in a format that shows vertical written links - no images. it almost looks like programming language, but it's readable.
    also, when we go between links, we often get the message that "safari can't find the server". this is, again, erratic. If i try to go directly to the same website by typing in the address in the bar, i will get the connection. (so, if i go from youtube for example to try to connect to another website it won't work. but if i try to go directly to that website by just typing in the address myself, i can get it.) as i said, it doesn't always happen, but when it does it's a real pain!
    lately, i've had a new problem too, which seems to relate: when using hulu.com, it will not load the show saying it is unavailable and to clear my cache. I've done that... and it still won't reload. yet, when i go to google, and search hulu.com, and go to the website that way, i can get to the show page no problem. Or, i have to quit safari and then go back to hulu and, again, no problem.
    sometimes we can go for days without the problem, sometimes not.
    any ideas on how to help this problem would be MOST appreciated! thanks

    blue question mark in box
    Go to Safari > Preferences then select the Appearance tab. Make sure Display images when the page opens is selected.
    For server issues, try turning off the router for a few minutes, then restart it.
    Hulu requires the Flash plugin. Uninstall your current copy of Flash, then reinstall >  Troubleshoot Flash Player | Mac OS
    Try emptying the Safari cache more often.
    And reset Safari. From your Safari menu bar click Safari > Reset Safari. Select the top 5 boxes, click Reset.
    And how much free space on the startup disk?     Right or control click the MacintoshHD icon. Click Get Info. In the Get Info window you will see Capacity and Available. Make sure there's a minimum of 15% free disk space.
    Try Safari in another user account. Same problems there, then log back into your admin account, launch Disk Utility.  /Applications/Utilities
    Select the startup disk in the panel on the left then select the First Aid tab.
    Click: Verify Disk  (not Verify Disk Permissions). If the startup disk needs repairing, follow the instructions for Using Disk Utility to verify or repair disks

  • How do i load images from a folder?

    Hello everyone,
    Please can someone help me as i am stuck.
    I am trying to research loading images from a folder called /images/unknown (unknown is a customer number and is stored in a variable called customerNo).
    I feel that i will need to load the images into an array then display them to the screen with a viewer.
    Can anybody help me.
    Thanks in advance

    Welcome to the Sun forums.
    irknappers wrote:
    ...Please can someone help me as i am stuck.You might want to be more exact in future, about what you are stuck on.
    import javax.imageio.ImageIO;
    import java.io.FileFilter;
    import java.io.File;
    import javax.swing.JFileChooser;
    class LoadImages {
        public static void main(String[] args) {
            String[] suffixes = ImageIO.getReaderFileSuffixes();
            FileFilter fileFilter = new FileFilterType(suffixes);
            File directory = null;
            if (args.length==1) {
                directory = new File( args[0] );
            } else {
                JFileChooser fileChooser = new JFileChooser();
                fileChooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY );
                int result = fileChooser.showOpenDialog( null );
                if ( result == JFileChooser.APPROVE_OPTION ) {
                    directory = fileChooser.getSelectedFile();
                } else {
                    System.err.println("Must select a directory to proceed, exiting.");
            File[] images = directory.listFiles( fileFilter );
            for (File file : images) {
                System.out.println(file);
            System.out.println( "The rest is left an exercise for the reader.  ;-)" );
    class FileFilterType implements FileFilter {
        String[] types;
        FileFilterType(String[] types) {
            this.types = types;
        public boolean accept(File file) {
            for (String type : types) {
                if ( file.getName().toLowerCase().endsWith( type.toLowerCase() ) ) {
                    return true;
            return false;
    }

  • Loading Images into Applets

    I've been having problems loading an image into an Applet. I've found that when the getImage() call is put into the init() method it loads the image fine, also implementing an imageUpdate call. However, now I'm trying to expand on this by putting it into a button click, it hangs indefinitely while waiting for the image to load.
    Another interesting point I've noticed is that the Canvas subclass ImageSegmentSelector uses a PixelGrabber in its constructor to put the Image into a buffer - when this class is created from the imageUpdate() call, NOT the init() call, the grabPixels() call hangs indefinitely too!!
    Any feedback, please,
    Jonathan Pendrous
    import java.applet.*;
    import java.net.*;
    import jmpendrous.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    public class XplaneGlobalSceneryDownloader extends Applet implements ActionListener{
    ImageSegmentSelector worldMap;
    Image img;
    URL url;
    int longtitude = 36;
    int latitude = 18;
    boolean imageLoaded;
    TextField t1, t2,t3;
    Label l1,l2,l3;
    Button b1;
    Applet a1;
    public void init() {
    a1 = this;
    l1 = (Label) add(new Label("Number of horizontal sections: "));
    t1 = (TextField) add(new TextField("45",3));
    l2 = (Label) add(new Label("Number of vertical sections: "));
    t2 = (TextField) add(new TextField("45",3));
    l3 = (Label) add(new Label("URL of image file: "));
    t3 = (TextField) add(new TextField("file:///C:/java/work/xplane_project/source/world-landuse.GIF",60));
    b1 = (Button) add(new Button("Load image"));
    b1.addActionListener(this);
    validate();
    // THIS CODE WORKS FINE ...
    /*try { url = new URL("file:///C:/java/work/xplane_project/source/world-landuse.GIF"); }
    catch(MalformedURLException e) { System.exit(0);   }
    img = getImage(url);
    //int w=img.getWidth(this);
    while(imageLoaded==false) { try { Thread.sleep(1000);   } catch(InterruptedException e) {System.exit(0);    } }
    worldMap = new ImageSegmentSelector(this, img, longtitude, latitude);
    add(worldMap);
    //resize(worldMap.getWidth(), worldMap.getHeight());
    validate();*/
    //repaint();
    //worldMap = new ImageSegmentSelector(this, img, longtitude, latitude);
    //repaint();
    public void actionPerformed(ActionEvent e) {
    try { longtitude = Integer.parseInt(t1.getText()); } catch (NumberFormatException ex) {System.exit(0); }
    try { latitude = Integer.parseInt(t2.getText()); } catch (NumberFormatException e2) {System.exit(0); }
    try { url = new URL(t3.getText()); }
    catch(MalformedURLException e3) { System.exit(0);   }
    img = getImage(url);
    //int w=img.getWidth(this);
    while(imageLoaded==false)
    { try { Thread.sleep(1000);   } //KEEPS ON LOOPING
    catch(InterruptedException e4) {System.exit(0);    } }
    worldMap = new ImageSegmentSelector(a1, img, longtitude, latitude);
    add(worldMap);
    //resize(worldMap.getWidth(), worldMap.getHeight());
    validate();
    public boolean imageUpdate(Image i, int flags, int x, int y, int w, int h){
    // THIS NEVER GETS CALLED AT ALL //
    if (((flags & ImageObserver.WIDTH) != 0) && ((flags & ImageObserver.HEIGHT) != 0)) {
    //worldMap = new ImageSegmentSelector(this, i, longtitude, latitude);
    //add(worldMap);
    //validate();
    //repaint();
    imageLoaded = true;
    return false;
    return true;
    }

    Sorry, thought this had been lost.
    You can load a file if the applet itself is run from the local filesystem - it loads it fine from the init(), but not otherwise. But I haven't got the applet to run from a browser yet without crashing (it's OK in the IDE debugger), so that's the next step.

  • Need help Loading images with selection on a form field?

    So I'm kind of a newb.. I can do basic forms but I need to set up a form field drop down box that will give me the ability to load images correlating to the users choice. I'm at a total loss for where to start, so ANY help would be appreciated. If you know of any good books or tutorials on the subject please share.
    Thanks in advance
    Sincerely,
    Stumped4now 

    P.S. I think I'm getting a better understanding of OCGs after lots of research today. However I still seem to be missing something
    var docOCGs = this.getOCGs();
    for (var x=0; x < docOCGs.length; x++)
      if(docOCGs[x].name == "Layer1")
      docOCGs[x].state = !docOCGs[x].state;

  • When i use IE9, i go to my emails and any pics in the mail open with the mail but with FF i have to download them is there a way to make the pics open in the mail, i set yahoo to load images automatically in the options menu this has had no effect, thanks

    some pictures(jpeg or gif) come as part of email if i use IE9 these images open as part of the mail, but with firefox i have to download them separately and then they don't appear in email. i have been in the options menu and allowed yahoo.com to automatically load images but this has had no effect, thanks

    Sounds like you did this on the fly.
    MM is supposed to open the Marker Panel Dialogue
    M just sets a marker
    Not sure if either are intended for on the fly during playback .
    There is also a Marker Icon on the Source Window Pane  >>

  • How can I create a new keyboard shortcut to toggle load images automatically preferrably with one action?

    I switch the load images automatically selection back and forth in order to save on my 5GB monthly data plan. Is there a utility that would allow me to create a macro of multiple keystrokes to do this with one action? Something like the macro function in Excel? Or is there another way to do this more easily than going to tools, options and clicking on the box? I don't see a shortcut for this item in the standard keyboard shortcuts list

    Hi,
    You could try [https://addons.mozilla.org/en-US/firefox/addon/image-block/?src=search Image Block]. Please also go through the reviews, help and ratings. You can also try to search for similar add-ons via Firefox '''Tools''' ('''Alt''' + '''T''') > '''Add-ons''', Search box on the top right corner, or via the official [https://addons.mozilla.org/ AMO].

  • Is there a way to not load images in safari? Like on android you can tick a box to load images or no to the internet?

    Is there a way to not load images in safari on ios 7 like in android there is
    The option to load or not load images?

    My reply here was specific for this thread, but as you noted, I didn´t read careful enough. I wrongfully took for granted that issues in the More Like This box was platform dependent. I tried to apolgize accordingly, I would like to see the post deleted, but that doesn´t stop you from policing obviously.
    And instead of arrogantly replying about matters irrelevant for this thread, maybe you should start reading more carefully yourself. The posts you are referring to are related to large images failing to load properly in Safari 7. This is not as you claim "vaguely related". Take this elsewhere if you have a problem with it.
    Again, sorry for messing up the thread.

  • Can you auto-load images in junk mail?

    Am I wrong in thinking that once you could make a choice to load images automatically when opening junk mail? Can you now?

    No, there is not. It wouldn't be reliable or useful. If Mail filters it as junk, presumably you won't be opening it, and thus loading the images, anyway. On the other hand, if it fails to recognize one message as spam and you open it, you'll load the images and become a "marked man." (ie, your address will be tagged as one where the spam is opened)

  • How do i backup the list of load images automatically exceptions under Options- Content. I want to transfer to another comp without re-adding one at a time

    How do i backup the list of load images automatically exceptions under Options->Content. I want to transfer to another comp without re-adding one at a time. EVen if there is no way to backup, what is the system file for Firefox that stores these, so i can transfer this file or open it in an XML or similar editor to copy them out?

    The permissions.sqlite file stores 'allow' and 'block' exceptions for cookies, images, pop-up windows, and extensions (software) installation.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder
    See also:
    *https://support.mozilla.org/kb/Recovering+important+data+from+an+old+profile
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • How to load images using xml in flash

    Hi
    im working on a quiz project where i plan to load images using xml in to flash, can any one help with the script with AS2 or 3

    You'll find a tutorial for what you are after here:
    http://www.gotoandlearn.com/play?id=22

  • Load Image in Forms 10g

    Dear All
    I want to load image from hard Disk to data base in forms 10g.
    I have a Image item and Browse button in my forms and in database it is a BLOB column.
    I need when i click on Browse Button then it will open the browse window and you can select on that.
    How to do ? Urgent , please help me .
    Thank you.

    or
    try this.
    declare
    l_file_name varchar2(383);
    begin
    l_file_name := webutil_file.file_open_dialog( );
    if
      l_file_name is not null
    then
      if
        :block.rowid is not null
      then
        create_record;
      end if;
      client_image.read_image_file ( l_file_name, substr ( l_file_name, instr ( l_file_name , -1 ) ), 'images.images' );
    end if;
    end;Note:- u have to attach webutil.pll without library it will not work.
    Sarah

Maybe you are looking for

  • Resource Center - Need to change a Local Resource to an Enterprise Resource

    The Resource Record for a resource was accidently deleted.  This resource was still assigned to active project tasks at the time of the delete.  A new Resource Record was created but it has the resource as a Local Resource.  How can I move this resou

  • OpenOffice to Applications box won't go away

    Every time I open OpenOffice the "OpenOffice to Applications" box pops up. I have already put OpenOffice in the Applications folder. How do I get rid of that box? Also, another OpenOffice icon pops up on the desktop every time I open the program, and

  • DHCP vs manual setup for small business peer to peer - which is better?

    We have perhaps 10 Macs, a few printers and an imagesetter networked peer to peer, currently using DHCP. Whenever power goes off (once a week sometimes) all of our aliases we use to connect to one another become useless as the router assigns new IP a

  • Steps to write a struts program in WSADv5.1.2???

    Hi Friends, I want to create a struts application in WSAD v5.1.2, so for that what are all the steps i need to follw from the scratch? Can u help me.???

  • Help on XQuery Retrieval

    I'm having a problem understanding the results of a Return in a FLWOR. Basically I want the second part of the XQuery to operate on the total return of the first part. I have a series of documents in one collection. Each document at the top level has