[noob needs help] Loading image from a URL

Hey everyone. I'm new here. And I'm new at J2ME as well.
I have a simple school project and I have doubts about it. I've searched everywhere on the net yet I could not find the solution. Anyways, I do understand the concept of loading images by putting the files in the "res" folder and use:
try
img = Image.createImage("/burgerimgsmall.jpg");
catch (Exception e)
e.printStackTrace();
But my project requires me to load an image from a URL. How do I go about doing that? If it helps, here's the URL:
http://img.photobucket.com/albums/v703/punkgila/burgerimgsmall.jpg
Thanks guys!

Don't worry, downloading image from http is also simple. Look into Photoalbum demo in wtk2.5

Similar Messages

  • I need to download image from the url and the image is in byte format.

    hi
    i need to download image from the url
    http://www.tidelinesonline.com/mobile/j2me_v1?reqType=imageJoin&imageCount=1&month=1&day=1&year=2008&id=1&imageWidth=230&imageHeight=216&imageDepth=8&imageUnits=feet&imageType=JPG&msisdn=456
    first 5 digits will be its length,we need to download except 5 digits.
    can any one know how to do that.
    thanks in advance
    Mraj

    hi
    i need to download image from the url
    http://www.tidelinesonline.com/mobile/j2me_v1?reqType=imageJoin&imageCount=1&month=1&day=1&year=2008&id=1&imageWidth=230&imageHeight=216&imageDepth=8&imageUnits=feet&imageType=JPG&msisdn=456
    first 5 digits will be its length,we need to download except 5 digits.
    can any one know how to do that.
    thanks in advance
    Mraj

  • 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;

  • Need help loading pics from multiple catalogs on Photoshop Elements 3

    In the past, I've synched my photos from Photoshop Elements 3 to my video Ipod without a problem, but I only had one catalog in Elements. I created a new catalog and wanted to upload some of the pictures in the NEW catalog to my ipod. The trouble is, when I go into the photo preferences in my Ipod, it only shows the albums in the catalog I'm in. I want to load some pics from both catalogs. If I switch to the second catalog it erases everything it loaded previously from the first catalog. Does anyone know a way to upload from multiple catalogs on my Ipod? Is it possible to do?
    Thanks!

    In the past, I've synched my photos from Photoshop Elements 3 to my video Ipod without a problem, but I only had one catalog in Elements. I created a new catalog and wanted to upload some of the pictures in the NEW catalog to my ipod. The trouble is, when I go into the photo preferences in my Ipod, it only shows the albums in the catalog I'm in. I want to load some pics from both catalogs. If I switch to the second catalog it erases everything it loaded previously from the first catalog. Does anyone know a way to upload from multiple catalogs on my Ipod? Is it possible to do?
    Thanks!

  • Need help loading data from Excel data file to oracle tables

    i need to load an Excel spreadsheet to Oracle table.
    The spreadsheet contains 20 columns, the first 8 columns contains basic info, but the rest 12 columns contains info like
    1stQtr_08, 2ndQtr_08, 3rdQtr_08, 4thQtr_08
    1stQtr_09, 2ndQtr_09, 3rdQtr_09, 4thQtr_09
    1stQtr_10, 2ndQtr_10, 3rdQtr_10, 4thQtr_10
    So what i need to accomplish is:
    break that one record(with 20 fields) in Excel to 3 records for each fiscal year in the Oracle table, so each record in the database table will look like
    8 basic field + fiscal_year + 1stQtr_08, 2ndQtr_08, 3rdQtr_08, 4thQtr_08
    8 basic field + fiscal_year + 1stQtr_09, 2ndQtr_09, 3rdQtr_09, 4thQtr_09
    8 basic field + fiscal_year + 1stQtr_10, 2ndQtr_10, 3rdQtr_10, 4thQtr_10
    There are about 10000 rows in the data file, so how can i use sqlldr to perform such task? beside sqlldr, any other good suggestions?
    thx

    External Tables is just an Oracle API for sqlloader. If you going to load this data over and over again, External tables would be a good idea, but if it's a one time thing, sqlldir is simpler, unless you just want to learn how to use External Tables.
    I used to run a data warehouse, so I have done, at least similar, to what you are doing in the past.

  • Need help loading tracks from compact disc

    I get my CD ejected on my powerbook when I insert some of my cd's to burn into my itunes folder. On my eMac I can load the songs fine. What gives? why does one computer eject the disc and the other will accept it and burn?

    What kind of disks? Pressed AudioCDs, DUAL-Disks or burned AudioCDs?
    Especially Dual-Disks will cause lots of problems when being used in slim line slot-it drives as those disks are not (completely) compatible to red book definitions.

  • Need help loading songs from computer to iPhone

    Problem moving songs from computer to iPone in same order

    How are you trying to get music on the phone, either via sync or manually manage music? And, what are you referring to when you say "in same order"?

  • TS1314 Need help tranfering images to iphone...

    I need help tranfering images from my computer to my iphone. I've synced the images but they don't appear on my iphone, also on the file that contains the images, there's a file that says IPOD PHOTO CACHE. I don't know what to do. Please Help...

    Hope these help, do you not find them at all in the photos app?:
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPhoto '11: View photos or slideshows on iPod, iPhone, iPad, or Apple TV
    http://support.apple.com/kb/PH2437
    iTunes: Understanding the iPod Photo Cache folder
    http://support.apple.com/kb/TS1314
    ============================
    - Oz

  • Problem loading image from jar file referenced by jar file

    First, I searched this one and no, I didn't find an answer. Loading images from jar files has been pretty much done to death but my problem is different. Please read on.
    I have my application, a straight up executable running from Eclipse. It uses a jar file, call it JarA. JarA launches a GUI that is located in another jar file. Call it JarB. To recap:
    My application calls JarA -> JarA loads classes from JarB -> JarB looks for images to place in a GUI it wants to show on the screen
    When JarB goes to load an image the following happens:
    java.lang.NullPointerException
         at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
         at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
         at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
         at java.lang.ClassLoader.getResource(ClassLoader.java:977)
         at org.cubrc.gmshell.gui.MainWin.preInit(MainWin.java:152)
         at org.cubrc.gmshell.gui.MainWin.<init>(MainWin.java:135)
    The code from JarB that loads the image looks like this:
              URL[] oSearch = {Main.class.getResource("images/")};
              URLClassLoader oLoader = new URLClassLoader(oSearch);
              imgIcon = new ImageIcon(oLoader.getResource("icon.gif"));
              imgMatchRunning = new ImageIcon(oLoader.getResource("gears.gif"));
              imgMatchStill = new ImageIcon(oLoader.getResource("gears-still.gif"));
              imgMagnify = new ImageIcon(oLoader.getResource("magnify.gif"));This looks right to me and JarB certainly has an images directory with those files. But I'm in hell right now because I don't know where to place the images to make this work or if you can even attempt to load images with a dependency chain like this.
    Any help very appreciated!

    Have you tried to move your image-files out of the jar file and place them in the sam folder as the jar-file? I think that would help.
    When you try to load the image-file you get the NullPointerException because the program tries to read a file it can't find. Remember that a jar file IS a file and not a directory.
    If you want to read somthing inside the jar-file you need to encode it first.
    Have you tried to read the jar-file with winRar. It makes it easy to add and remove files in your jar-file.

  • 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;
    }

  • Inserting an image from an URL in a BLOB

    Hello all,
    As it's said in the title, I need a PL/SQL procedure to insert a image from web URL in a BLOB table column.
    How can I do that?
    Thanks in advance for your help.
    Max

    found this on the internet http://www.oracle-base.com/articles/misc/RetrievingHTMLandBinariesIntoTablesOverHTTP.php
    CREATE TABLE http_blob_test (
      id    NUMBER(10),
      url   VARCHAR2(255),
      data  BLOB,
      CONSTRAINT http_blob_test_pk PRIMARY KEY (id)
    CREATE SEQUENCE http_blob_test_seq;
    CREATE OR REPLACE PROCEDURE load_binary_from_url (p_url  IN  VARCHAR2) AS
      l_http_request   UTL_HTTP.req;
      l_http_response  UTL_HTTP.resp;
      l_blob           BLOB;
      l_raw            RAW(32767);
    BEGIN
      -- Initialize the BLOB.
      DBMS_LOB.createtemporary(l_blob, FALSE);
      -- Make a HTTP request and get the response.
      l_http_request  := UTL_HTTP.begin_request(p_url);
      l_http_response := UTL_HTTP.get_response(l_http_request);
      -- Copy the response into the BLOB.
      BEGIN
        LOOP
          UTL_HTTP.read_raw(l_http_response, l_raw, 32767);
          DBMS_LOB.writeappend (l_blob, UTL_RAW.length(l_raw), l_raw);
        END LOOP;
      EXCEPTION
        WHEN UTL_HTTP.end_of_body THEN
          UTL_HTTP.end_response(l_http_response);
      END;
      -- Insert the data into the table.
      INSERT INTO http_blob_test (id, url, data)
      VALUES (http_blob_test_seq.NEXTVAL, p_url, l_blob);
      -- Relase the resources associated with the temporary LOB.
      DBMS_LOB.freetemporary(l_blob);
    EXCEPTION
      WHEN OTHERS THEN
        UTL_HTTP.end_response(l_http_response);
        DBMS_LOB.freetemporary(l_blob);
        RAISE;
    END load_binary_from_url;
    EXEC load_binary_from_url('http://forums.oracle.com/forums/themes/english/resources/oralogo_small.gif');

  • Problem loading images from a return value of a function

    hello, I write because I uin problem in loading images from a return value of a function.
    I created a database with a field "image" of type string, where I put the physical address of the image. I have written like this: {__DIR__ }foto.jpg
    Place the code, so you understand better
    function imageViewImage(): javafx.scene.image.Image {
    connetti();
    lass.forName(driverName);
    con = DriverManager.getConnection(url,user,"");
    stmt = con.createStatement();
    var richiesta:String = "SELECT image from viaggio WHERE id_viaggio=7";
    rs1 = stmt.executeQuery(richiesta);
    var result :String;
    rs1.next();
    risultato = rs1.getString("image");
    JOptionPane.showMessageDialog(null, result);
    var imagez = Image{
    url:"{result}";
    return imagez;
    The image is in the source code package
    First I connect to the database, run the query and I take the contents of the image.
    Can anyone help me?
    Is right to put in the database {__DIR__} foto.jpg or do I put only foto.jpg?

    Hello unkus_nob,
    I would rather suggest you to save only filename of that image like "foto.jpg" in database. And just concat it with the String variable containing "{__DIR__}".
    Actually the javafx compiler converts the {__DIR__} to the existing class directory path something like : "jar:file:/..../".
    var currentDir ="{__DIR__}";
    risultato = "{currentDir}{rs1.getString("immagine"})"; 
    var image = Image{
        url:risultato
    return image;--NARAYAN G.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to load images from BLOB to javascript?

    hi, Guys:
    I need to load thumbnail images from BLOB to multiple markers' infowindow in Google map . I have implemented Google map in APEX. I load the data suchas text for every marker's infowindow from Oracle database table with PL/JSON, and infowindow works fine. Could anyone give me a suggestion or example so I know how to load images to javascript?
    Thanks a lot.
    Database: Oracle 11g R2
    APEX: APEX 4.1
    Thanks.
    Sam

    lxiscas wrote:
    hi, VC:
    Thanks for your kind reply. I need to render these images out of APEX session, actually in javascript that is related to Google map markers' infowindow.
    I checked the documents of APEX_UTIL.GET_BLOB_FILE_SRC, but my impression is I need to use it in APEX instead of javascript if my understanding is correct. I already implemented a procedure with PL/SQL to load images from a BLOB column in Oracle database. But the problem is, how can I pass it to javascript code out of APEX to javascript (I could pass text or number from APEX to javascript with PL/JSON though,But I assume that still google map will be within a valid apex session? if so you should be able to use the above api.
    Basically what this api does is generates a kind of url to each blob in the database, not sure how google api's deal with this though. Why don't you give it a try?
    The other option is to make your pl/sql procedure public and then you can generate the json to include the images urls such as:
         "employees" : [{
                   "firstName" : "John",
                   "lastName" : "Doe",
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
                   "firstName" : "Anna",
                   "lastName" : "Smith"
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
                   "firstName" : "Peter",
                   "lastName" : "Jones"
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
    }And then you can use this new attribute to populate the images in javascript using standard img tag
    See this tutorial http://docs.oracle.com/cd/E14373_01/appdev.32/e13363/up_dn_files.htm
    I did not find any method in PL/JSON to pass image object)? So far I only found example to load images from local files to javascript.Hmm..I don't think you should load image objects.
    Vikram

  • Adobe Flex unable to load images from Amazon S3

    I have a flex 3 app that is attempting to load images from Amazon S3. The images fail to load, so I fired up debug mode. In debug mode, the images load, but I also get the following output in the debugger:
        *** Security Sandbox Violation ***
        SecurityDomain 'http://mybucket.s3.amazonaws.com/logos/mylogo.png' tried to access incompatible context 'http://localhost/myapp/bin-debug/index.html?debug=true'
    I have added a crossdomain.xml file into the root of my bucket as follows, but this does not seem to help:
        <?xml version="1.0" encoding="utf-8" ?>
        <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
        <cross-domain-policy>
          <site-control permitted-cross-domain-policies="master-only" />
          <allow-access-from domain="*" />
          <allow-http-request-headers-from domain="*" />
        </cross-domain-policy>
    I then tried the following:
    Security.loadPolicyFile('http://mybucket.s3.amazonaws.com/crossdomain.xml');
    Security.allowInsecureDomain('http://mybucket.s3.amazonaws.com/');
    Security.allowDomain('http://mybucket.s3.amazonaws.com/');
    At this point, it seems that there are not any more errors reported in debug mode. However, when not in debug mode, then the image still does not load.
    Am I missing something obvious here?

    If you are not getting creationComplete in release vs debug builds, it is best to try to identify the differences between the two runtime environments.
    Is the URL to the SWF the same?  Some folks find that their release folder is missing some important file.
    Is the URL to the HTML wrapper the same?  Some folks launch their debug from file:// and their release from http:// which have different security rules
    Is the launch step the same?  Some folks launch their debug from FlashBuilder and their export via some other mechanism.  This can alter the initial size of the app and that difference can cause some apps to get into a “layout loop” and never hit creationComplete.  To find out if you are in such a loop, report calls to updateDisplayList, and measure() on various compoonents and see if they keep getting called.
    Is there a timing difference?  Some apps may have subtle timing dependencies that change when the release build runs faster.

  • Loading image from jars only once in oracle forms 10g

    Hi,
    I have an oracle forms 10g application which loads image from a jar. Every time i click on a button "A" that loads the image "image" on another button "B" in the same screen, a message is displayed in the java console "Loaded image: jar:https://+IP+/forms/java/+myjar+.jar!/image.gif". So after 10 clicks, i get the same message displayed 10 times. In the form, i've called:
    SET_CUSTOM_PROPERTY(p_object_name, 1, 'IMAGE_NAME_ON', '/'||p_image_name);My question is the following:
    - is there a way to load this image once and use it later without having to load it every time i clik on "A"? if yes, how?
    P.S.: if this thread shouldn't be posted in this forum, please redirect me to the right one.
    Thanks in advance

    Ah okay.
    I'm using the rolloverbutton.jar (RollOver Button PJC) [RolloverButton.java -> authors: Steve Button, Duncan Mills].
    Here is the part concerning the IMAGE_NAME_ON function:
    // make sure we are in rollover mode
    enableRollover();
    log("setProperty - IMAGE_NAME_ON value=" + value.toString());
    // load the requested image
    m_imageNameOn = (String) value;
    loadImage(ON,m_imageNameOn);
    // reset the currrently drawn image if needed
    setImage(ON,m_state);
    return true;where loadImage function is:
        URL imageURL = null;
        boolean loadSuccess = false;
        //JAR
        log("Searching JAR for " + imageName);
        imageURL = getClass().getResource(imageName);
        if (imageURL != null)
          log("URL: " + imageURL.toString());
          try
            m_images[which] = Toolkit.getDefaultToolkit().getImage(imageURL);
            loadSuccess = true;
            log("Image found: " + imageURL.toString());
          catch (Exception ilex)
            log("Error loading image from JAR: " + ilex.toString());
        else
          log("Unable to find " + imageName + " in JAR");
        //DOCBASE
        if (loadSuccess == false)
          log("Searching docbase for " + imageName);
          try
            if (imageName.toLowerCase().startsWith("http://")||imageName.toLowerCase().startsWith("https://"))
              imageURL = new URL(imageName);
            else
              imageURL = new URL(m_codeBase.getProtocol() + "://" + m_codeBase.getHost() + ":" + m_codeBase.getPort() + imageName);
            log("Constructed URL: " + imageURL.toString());
            try
              m_images[which] = createImage((java.awt.image.ImageProducer) imageURL.getContent());
              loadSuccess = true;
              log("Image found: " + imageURL.toString());
            catch (Exception ilex)
              log("Error reading image - " + ilex.toString());
          catch (java.net.MalformedURLException urlex)
            log("Error creating URL - " + urlex.toString());
        //CODEBASE
        if (loadSuccess == false)
          log("Searching codebase for " + imageName);
          try
            imageURL = new URL(m_codeBase, imageName);
            log("Constructed URL: " + imageURL.toString());
            try
              m_images[which] = createImage((java.awt.image.ImageProducer) imageURL.getContent());
              loadSuccess = true;
              log("Image found: " + imageURL.toString());
            catch (Exception ilex)
                    log("Error reading image - " + ilex.toString());
          catch (java.net.MalformedURLException urlex)
            log("Error creating URL - " + urlex.toString());
        if (loadSuccess == false)
          log("Error image " + imageName + " could not be located");In this case, what shall i modify?
    Thanks in advance

Maybe you are looking for

  • Acrobat 8 Standard and X Pro

    I have Acrobat 8 Standard. I would like to be able to create forms that allow users to add info to fields and to be able to submit those forms. I have been looking over the info on X Pro but I am wondering if I order the software upgrade, will I need

  • Ive just restored my iphone but it wont let me activate it now, either by wi-fi or through itunes. what do i do?

    Ive just restored my iphone but it wont let me activate it now, either by wi-fi or through itunes. what do i do? I just bought the phone off ebay and it was working fine before I tried to update it. This is when the problems started. Firstly, it woul

  • Проблема с оглавлением/The problem with the table of contents

    Добрый день, я использую Pages 5.5.2 и при создании оглавления у меня возникла проблема: Если поставить фильтр по заголовкам, а не использовать все, как предлагается в начале, то гиперссылки в нумерации обновлении сбиваются. Например: Заголовок 1    

  • D300 raw files in A2 - Colors are terrible?

    I've been using Nikon's Capture NX software to edit my D300 raw files since Aperture 1.5 didn't support D300 raw files. Tonight, I downloaded the trial version of Aperture 2.0 and imported some of my D300 raw files into A2. Side by side comparison is

  • IChat closes when I try to use the camera, help!

    Hi all. I updated to Lion yesterday and ever since then I'm having a problem with iChat. When I click the green camera icon to start a chat, or when I go into Preferences and try to view the Audio/Video panel, iChat closes. Every time. Tried restarti