Loading images in List as ImageIcon causes OutOfMemoryError.

I am trying to figure out why the bit of code below is causing such a memory problem. I have the JRE starting up with 256MB of ram (got 2GB on system). I am loading 200K images at most, and after 3 or so images, I am getting lots of OutOfMemory exceptions. Any ideas?
List images = new ArrayList(50);
File[] files = f.listFiles(new FileFilter() {
                    public boolean accept(File fi) {
                         // Only allow .gif, .png, .jpg and .jpeg
                         String ext = fi.getName().toLowerCase();
                         if (fi.isFile() && (ext.indexOf(".png") > 0)
                                   || (ext.indexOf(".gif") > 0)
                                   || (ext.indexOf(".jpg") > 0)
                                   || (ext.indexOf(".jpeg") > 0)) {
                              return true;
                         return false;
               if (null != files && files.length > 0) {
                    for (int cntr = 0; cntr < files.length; cntr++) {
                         try {
                              File fil = (File) files[cntr];
                              System.out.println("Loading " + fil.getAbsolutePath());
                              ImageIcon ii = new ImageIcon(fil.getAbsolutePath());
                              images.add(ii);
                         } catch (Throwable e) {
                              // ignore any per file to image translation errors.
                              e.printStackTrace(System.out);
               }

Thanks for the reply. However, my situation is a little different. I preload up to 100 images first, then rapidly display them on screen like a lottery number. After loading the first 200K image, I get an OutOfMemoryError which is VERY odd to me. I originaly was loading 2MB images and resizing them to smaller size using BufferedImage and such. But that was giving me the problems. So I set Xmx256M, and resized the images in photoshop, and STILL I get memory problems and the app wont run. It is very odd. It's as if anything larger than 64K images can't be loaded using ImageIcon. But I know I've loaded them before as well.
So I guess the thing is, what is the right way to load many images into memory. Maybe ImageIcon is not the right way.

Similar Messages

  • I accidentally deleted all of the exceptions to the load images automatically list. What is the list of websites that are the exceptions and how do I get them all back onto the list at once?

    I accidentally removed all sites in the tools->options->content->load all images automatically.
    I need to know what the names of these sites are and how to get them all blocked again all at once.
    == This happened ==
    Just once or twice
    == when i accidentally removed all sites from the list

    There's no way to recover this list if you deleted the items, as it's not backed up.
    Why did you have the sites blocked in the first place? You can simply re-block the sites as you see the images in order to re-build your list.

  • How to load images in List from Xml and view the image and resize the image & save in Flex?

    Hi Friends,
    I am new to flex i am doing application for image resizing rotating and save the resize image.
    I want to load the images from xml file to listcontrol and show that images as a icon in the listview,then i want to drag that image to panel that time it should show it original size of the Image.then it allows user to resize ,crop,rotate the image.then i want to save the resize image,when i save the resize image it should replace the original image in the xmllist.
    I am looking for some useful suggession ,if you dont mind want to see some snippet code.
    It will help me to understand the concept.
    Cheers,
    B.Venkatesan

    Not in Crystal Reports Basic for Visual Studio 2008. You'll have to upgrade to CR 2008 (12.x). Then use kbase [1320507|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] as a guide on how to do this.
    Ludek

  • 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

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

  • Problem in loading images when i am connected on company network

    Hi friends, I am using firefox since last 4 months on my windows 8 pro laptop.but since last month I am facing problem in loading images when i am connected on company network but same time it is working fine with ie10. But all these thinks are working well at my home when I am using broadband.

    I don't completely understand your issue. Does this issue occur on 1 network and does not occur on another? Have you tried clearing cache and cookies and making sure your plugins are up to date?
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    Please check if all your plugins are up-to-date. To do this, go to the [http://mozilla.com/plugincheck Mozilla Plugin Check site].
    Once you're there, the site will check if all your plugins have the latest versions.
    If you see plugins in the list that have a yellow ''Update'' button or a red ''Update now'' button, please update these immediately.
    To do so, please click each red or yellow button. Then you should see a site that allows you to download the latest version. Double-click the downloaded file to start the installation and follow the steps mentioned in the installation procedure.

  • BufferedImage causing OutOfMemoryError not getting GC'd

    I'm writing a photo library application just for practice. I'm trying to display all the jpegs in an album by displaying thumbnails of them as ImageIcons in JLabels on a JFrame.
    To get the images I use ImageIO.read(File) into a BufferedImage. Then using Image.getScaledInstance I pass the resized image to a new ImageIcon which is added to the JLabel. This all happens in a final class ThumbDisplay, method showPic which returns the JLabel.
    I call ThumbDisplay.showPic(File) in a loop, and it can read about 5 files before throwing an OutOfMemoryError. I have been able to successfully display no more than 4 images. Most of my images were taken on my digital camera and are around 2560X1920.
    I read a bit about the java heap space and I understand how 5 BufferedImages of that size open at once can easily eat up memory. But the code looks to me that any instantiated BufferedImages would be GC'd as soon as the showPic method returned the JLabel. JHAT proved otherwise and there were still 5 instances of BufferedImage when I got the OutOfMemoryError.
    So, the following is my example code block and the StackTrace. No extra stuff required. Just throw about 10 extra large jpegs in whatever path you choose to put in 'File directory' on line 9, compile and run. I'd really appreciate some help on this. I've searched countless message boards for that error and found many similar topics but ZERO answers. Can someone tell me why these aren't getting GC'd?
    code:
    1. import javax.swing.*; 
       2. import java.awt.image.*; 
       3. import javax.imageio.*; 
       4. import java.awt.*; 
       5. import java.io.*; 
       6.  
       7. public class ThumbTest{ 
       8.     public static void main(String args[]){ 
       9.         File directory = new File("c:\\pictemp\\"); 
      10.         File[] files = directory.listFiles(); 
      11.         JFrame jf = new JFrame(); 
      12.         jf.setSize(1000,1000); 
      13.         jf.setLayout(new GridLayout(10,10,15,15)); 
      14.         for(File file : files) 
      15.             jf.add(ThumbDisplay.showPic(file)); 
      16.          
      17.         jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
      18.         jf.setVisible(true); 
      19.  
      20.  
      21.     } 
      22. } 
      23.  
      24. final class ThumbDisplay{ 
      25.      
      26.     public static JLabel showPic(File f){ 
      27.         BufferedImage img = null; 
      28.         try{ 
      29.             img = ImageIO.read(f); 
      30.         }catch (IOException e){ 
      31.             e.printStackTrace(); 
      32.         } 
      33.         if(img != null){ 
      34.             float ratio = 100 / (float) img.getHeight(); 
      35.             int w = Math.round((float)img.getWidth() * ratio); 
      36.             int h = Math.round((float)img.getHeight() * ratio); 
      37.             return new JLabel(new ImageIcon(img.getScaledInstance(w,h,Image.SCALE_DEFAULT))); 
      38.         } else 
      39.             return new JLabel("no image"); 
      40.     } 
      41. }exception:
       1. D:\java\Projects\PhotoLibrary>java ThumbTest 
       2. Exception in thread "main" java.lang.OutOfMemoryError: Java heap space 
       3.         at java.awt.image.DataBufferByte.<init>(Unknown Source) 
       4.         at java.awt.image.ComponentSampleModel.createDataBuffer(Unknown Source) 
       5.         at java.awt.image.Raster.createWritableRaster(Unknown Source) 
       6.         at javax.imageio.ImageTypeSpecifier.createBufferedImage(Unknown Source) 
       7.         at javax.imageio.ImageReader.getDestination(Unknown Source) 
       8.         at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Sou 
       9. rce) 
      10.         at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source) 
      11.         at javax.imageio.ImageIO.read(Unknown Source) 
      12.         at javax.imageio.ImageIO.read(Unknown Source) 
      13.         at ThumbDisplay.showPic(ThumbTest.java:29) 
      14.         at ThumbTest.main(ThumbTest.java:15) 

    sjasja wrote:
    ImageIO.read() does not cache images. Run ImageIO.read() in a loop for a large image. No OOME.
    Run the OP's original program under hprof. See in hprof's output how the original image data are retained. Gives an OOME, and hprof's output shows where the memory goes.
    After creating a resized image with Image.getScaledInstance(), make a copy of the resized image and discard the first resized image. (Create a BufferedImage, get a Graphics2D, and blit with g.drawImage()). Discarding the resized image will also make the pointer to the original large image go away, allowing GC. No OOME.
    In the OP's program, edit like so:
    // return new JLabel(new ImageIcon(img.getScaledInstance(w,h,Image.SCALE_DEFAULT))); 
    new JLabel(new ImageIcon(img.getScaledInstance(w,h,Image.SCALE_DEFAULT)));
    return new JLabel("yes image");You are now doing all the image loading and resizing the original program does. But because the JLabel is discarded, the pointer to the resized image is discarded, thus the pointer to the original image is discarded, and everything can be GCd. No OOME.
    If you want to see how the scaled image retains a pointer to the original image, see the interaction of Image.getScaledImage(), BufferedImage.getSource(), java.awt.image.FilteredImageSource, sun.awt.image.OffScreenImageSource, and sun.awt.image.ToolkitImage.
    By these experiments, in a reply above, I guesstimated: "As far as I can figure out, Image.getScaledInstance() keeps a pointer to the original image."
    Yes, getScaledInstance() is somewhat slow. Here is the FAQ entry for a better way to resize an image: http://java.sun.com/products/java-media/2D/reference/faqs/index.html#Q_How_do_I_create_a_resized_copy
    I have a problem with this because it should mean that the code fragment I posted in reply #5 should make no difference but I can load over a thousand images using it whereas the original code allowed me to load only 30 or so.
    I can see how creating a buffered image from the scaled image might help since discarding the scaled image will discard any reference to the original image stored in the scaled image.

  • Applet not loading correctly (likely due to ImageIcon)

    So I have a Tetris game that I made and I'm trying to publish it to the web. I made it an applet, and the thing plays in the appletviewer fine. However, when I load it in an actual browser it just has an X, so I right click and click "Open Java Console" and it gives me the error I listed below
    I think it has to do with me using ImageIcons that load other files (the actual images). These images are on the server, not the users system, so im not sure why its a problem, plus the fact that it loads in the java applet viewer fine.
    Any ideas?
    Thanks,
    Graeme
    Java Plug-in 1.5.0_02
    Using JRE version 1.5.0_02 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Main
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    p: reload proxy configuration
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    java.security.AccessControlException: access denied (java.io.FilePermission sprite.gif read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkRead(Unknown Source)
         at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
         at sun.awt.SunToolkit.getImage(Unknown Source)
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at Tetris.<init>(Tetris.java:60)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    java.security.AccessControlException: access denied (java.io.FilePermission sprite.gif read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkRead(Unknown Source)
         at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
         at sun.awt.SunToolkit.getImage(Unknown Source)
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at Tetris.<init>(Tetris.java:60)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    waiting
    done
    java.security.AccessControlException: access denied (java.io.FilePermission sprite.gif read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkRead(Unknown Source)
         at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
         at sun.awt.SunToolkit.getImage(Unknown Source)
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at Tetris.<init>(Tetris.java:60)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    java.security.AccessControlException: access denied (java.io.FilePermission sprite.gif read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkRead(Unknown Source)
         at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
         at sun.awt.SunToolkit.getImage(Unknown Source)
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at Tetris.<init>(Tetris.java:60)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    java.security.AccessControlException: access denied (java.io.FilePermission sprite.gif read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkRead(Unknown Source)
         at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
         at sun.awt.SunToolkit.getImage(Unknown Source)
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at Tetris.<init>(Tetris.java:60)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    waiting
    done

    How are you specifying the images to load? I think the best approach is to use getResource() which loads image files via the same mechanism that loads classes.
    ImageIcon icon1 = new ImageIcon(getClass().getResource("sprite.gif"));Will load the icon from the same directory where it got the class file, even if it's in a .jar, on a server or both.

  • Firefox does not load images over HTTPS

    When viewing secure sites (HTTPS) images are not displayed on FF 3.6.6
    For example: I can not see images on Gmail, Google Images or StumbleUpon
    I have checked the images settings and it automatically loads images from all sites, there are no domains blocked
    There is no add-on to block images
    Javascript is enabled
    I've tested almost all network configuration but the problem persists
    If I inspect the image with Firebug 1.5.4 the image is available as preview
    The same page is correctly displayed on IE8
    I've tested in safe-mode but the error remains
    Again... I suspect it has something to do on how FF 3.6.6 handles HTTPS
    Even if you do not have an answer, post if you experience the same problem.
    Thanks for your help!
    == This happened ==
    Every time Firefox opened
    == After las upgrade

    Try "Reset all user preferences to Firefox defaults" on the [[Safe mode]] start window - See http://kb.mozillazine.org/Resetting_preferences
    See also http://kb.mozillazine.org/Preferences_not_saved
    Create a new profile as a test to check if your current profile is causing the problems
    See [[Basic Troubleshooting|#Make_a_new_profile|Basic Troubleshooting: Make a new profile]]
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins"
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Why after ccleaner mozilla not load images in some websites. How fix it?

    Why after ccleaner mozilla not load images in some websites. How fix it?

    You can use these steps to block images from a specific domain:
    * Open the web page that has the images in a browser tab.
    * Click the website favicon ([[Site Identity Button]]) on the left end of the location bar.
    * Click the "More Information" button to open the "Page Info" window with the Security tab selected (also accessible via "Tools > Page Info").
    * Go to the <i>Media</i> tab of the "Tools > Page Info" window.
    * Select the first image link and scroll down through the list with the Down arrow key.
    * If you want to block images then place check-mark in the box "<i>Block Images from...</i>" to block the images from that domain.
    You can set the permissions for the domain in the current tab in Tools > Page Info > Permissions

  • Firefox not loading images on certain pages

    All of a sudden, Firefox no longer loads images on certain pages. I updated to 32.0.3. yesterday so thought that was the problem. I uninstalled and reinstalled 32.0.3. but that didn't help. I deactived the add-ons, but that didn't help either. I then installed FF 31, but the problem persists. I don't have the problem with Safari.
    I'm lost ….
    P.S. I had to upload the image via Safari, didn't work via Firefox

    Your System Details list shows that you were only allowing images from the originating page and were blocking third-party images hosted on other servers.
    *permissions.default.image: 3
    These days a lot of sites store content on other dedicated servers, so it is best to leave such a setting at its default of 1 to allow all images.

  • Apple Mail - Load images for some email addresses automatically

    Is it possible in Apple Mail to put some email addresses on a white list so that the images within their emails always load?
    I don't want all images to load for every email I get, but I find it an annoyance to have to often load images from contacts I already trust.

    AppleScript to the rescue!  Thank you Linc Davis!!!
    Still find it strange Apple doesn't have this built into the Mail interface as an option and have to run a script [grumble].

  • Referencing loaded images in APEX

    Hi all:
    Up until this point, I have used the same method of getting images to be recognized by an Apex
    installation. That specifically has been through loading images into a physical directory on the
    machine where APEX was installed. This was made available to me by the DBA that installed APEX.
    This is Application Express 2.2.0.00.32 running on AIX Unix.
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    This arrangement worked. I was able to reference any image loaded to that directory using
    "/i/[image].gif". "/i/" was set as my pseudo directory by default on Apex.
    Over time, I developed an application that is now ready to deploy in like environments and I have
    never had a problem with viewing graphics.
    For the purposes of demoing to a specific customer, I was asked to deploy this to a different environment
    temporarily, I was given the option of loading my application to a Windows XP environment running
    Oracle XE and Application Express 2.1.0.00.39.
    Since there was no physical directory that I could locate for images, it seemed to me that my only
    option was to load my images using the wizard for loading image file components (which I understand
    means using XDB)...
    I was not been able to get this to work. I went back to my AIX Unix/Oracle 10g installation and attempted
    to do the same (load images as a file component and reference them). To my surprise it didn't work there
    either.
    These are the steps I took in attempting this:
    1.) Within my application definition, go to "Shared components"
    2.) Under the Files section, I click on "images"
    3.) Click on the button labeled "Create"
    4.) The page "Create Image" appears. I click on the "Browse" button and I pick the image from my local file system.
    5.) I leave the drop-down list as is (reading "No Application Associated")
    6.) I click on the "Upload" button.
    I then go back to my application under "Edit Attributes" and reference the file as /i/[file].gif
    I find that the images do not show up. On IE, all I get is the standard red "X" indicating that
    an image file failed to load.
    I can't help thinking that I'm missing an obvious step. Let me know if there's any other info I should
    provide.
    Thanks

    HI,
    To reference images loaded through shared components use:
    #WORKSPACE_IMAGES#filename.gif (when you set it to No Application Associated)
    or
    #APP_IMAGES#filename.gif (when you associate it with a specific application)
    Graham

  • How can i make firefox not load images from certain websites permanantly

    I am unable to block images on certain websites permanently. However, I can block images temporarily for a session through Option > Content > Load images automatically but whenever i clean the browser history or close down firefox the customized list that i entered disappear and i am back to square and again manually enter websites one by one and the same thing happens again.

    You can inspect and manage the permissions for all domains on the <b>about:permissions</b> page.
    *https://support.mozilla.org/kb/how-do-i-manage-website-permissions
    In case you are using "Clear history when Firefox closes":
    *do not clear the "Site Preferences"
    *Tools > Options > Privacy: History: [X] Clear history when Firefox closes > Settings
    *https://support.mozilla.org/kb/Clear+Recent+History
    Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.

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

Maybe you are looking for

  • Video input/ iMac display as monitor

    Hello everybody, I have got a feature request for future releases of the iMac series. I think I would not be the only one appreciating a solution to use an iMac's display as monitor for other computing devices such as the Mac mini or older PC-hardwar

  • Create a DMS Document (similar to CV01N) using WDA

    Hi All, I have a requirement to upload some documents from the frontend system (user's system) to the DMS. We have a standard BAPI available for creating a document in DMS i.e. BAPI_DOCUMENT_CREATE2 but I am not able to attach any file along with thi

  • Help! what does battery with ! mean?

    I connect my ipod mini to the computer and the battery with the '!' mark shows up and nothing happens. I read a link someone sent in response to the same question and it still did not answer my question. I use the same cable and connect another iPod,

  • Need help with transferring DW files to new computer

    I purchased a second computer - installed DW on new computer and connected to server - but am having a problem getting the site files installed correctely. On comp#1, in the sidebar I can switch between local and remote -- and there are arrows to upl

  • Safari (7.0.5) throws up "top sites" page when I try to open archived pages

    This suddenly started happening out of the blue and I don't know why.  I often save pages to my desktop for later reference.  I've been doing this for years.  But all of the sudden, when I double click one of the archived pages...or drag it to Safari