Won't display images - Its probably something simple!

Hey ,
Ive been trying for ages, looked throught the tutorials (i have even tried just using java pasted from the site for one of the simple programs) and looking through old forum questions but can't find out why my GUI wont display images. It compiles fine but then when i run the program ... no pics!
I suspect its something to do with the directory, i have tired:
- putting the images in the same directory as the java classes,
- putting in the entire image location paths (for this i get illegal characters error because it has '\' in the path but i get round this using '\\' ) but still no joy.
Like i said am just using the example programme from the site so i know its correct, Any ideas??
Thanx
Lisa

Here is a simple program to test:
JFrame frame = new JFrame();
JLabel label = new JLabel("image.jpg");
frame.getContenPane()..add( label );
frame.pack();
frame.setVisible(true);a) Place "image.jpg" is the same directory as the source and class files.
b) Don't use any package names for you class.
c) Compile using javac, not through and ide or anything.
d) Make sure your classpath includes ".", so it will search the current directory.

Similar Messages

  • Messages won't display images, sandbox violation?

    Can anyone help me figure out why, when I receive an iMessage that contains a photo or other image, Messages on Yosemite won't display the image? It appears to be a sandbox permissions issue, but I can't figure out how to resolve it.
    Briefly, when I receive an iMessage that contains any image, the image displays just fine on my iOS devices, but in OS X Yosemite (10.10.1, build 14B25), it just shows up as a generic icon (attached at the bottom of this question). Clicking the icon or magnifying glass doesn't load it, double-clicking it doesn't load it, Quick View won't show it... nothing. If I look in /var/logs/system.log, any attempt to view it generates sandbox-related errors:
    Messages[30820]: [Warning] Transfer: unable to create image for IMG_2758.JPG.jpeg
    kernel[0]: Sandbox: Messages(30820) deny file-read-data /private/var/folders/7l/cn4n4k4n4p31ncqq9qqk1klrydkmkm/T/IMG_2758.JPG.jpeg
    If I manually open up that directory (/private/var/folders/7l/cn4n4k4n4p31ncqq9qqk1klrydkmkm/T/) I can see the image and open it myself, but Messages can't do it... and I can't for the life of me figure out how Messages's sandbox is configured and what is going on here.
    This all happened when I upgraded to Yosemite; prior to Yosemite, everything worked fine. I've tried to blow away /private/var/folders/7l/ and let it get rebuilt, to no avail. I've also hunted for Messages's sandbox config file, to no avail.
    Help?
    Thanks in advance!
    Jason

    Hi,
    That does seem odd.
    I mentioned the Containers things as this is the Read and Write route that the app uses (normally to the aliases in the /Data/Library/Preferences that pints to ~/library/Preferences)
    I also looked in those places but for IDS, SOAgent and IMAgent that are also involved but no luck.
    On your Console Location for the Var Stuff I have this
    See Path Bar across bottom. This pic of Dec 1st I had to open in Preview.
    A Different view if it helps
    I am not sure what to suggest at this point.
    8:28 pm      Tuesday; December 9, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • JLabel won't display image until all methods have completed

    Hi,
    I?m trying to deal playing cards. I can click a button to deal one card at a time
    but I?m trying to set it up so it runs 25 cards with a delay on each card.
    Otherwise, it just puts up 25 cards at the same time.
    I?ve been reading about threads and swing delays but the same thing happens.
    It runs the methods and displays it all in one shot.
    Below is code for displaying one card. It works fine
    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    ic[icCount] = new ImageIcon(Deck.cardMatrix[matRow][matCol]);
    if(icCount ==1 ) jLabel1.setIcon((Icon) ic[icCount]);
    if(icCount ==2 ) jLabel2.setIcon((Icon) ic[icCount]);
    if(icCount ==3 ) jLabel3.setIcon((Icon) ic[icCount]);
    if(icCount ==4 ) jLabel4.setIcon((Icon) ic[icCount]);
    if(icCount ==5 ) jLabel5.setIcon((Icon) ic[icCount]);
    if(icCount ==6 ) jLabel6.setIcon((Icon) ic[icCount]);
    if(icCount ==7 ) jLabel7.setIcon((Icon) ic[icCount]);
    if(icCount ==8 ) jLabel8.setIcon((Icon) ic[icCount]);
    if(icCount ==9 ) jLabel9.setIcon((Icon) ic[icCount]);
    if(icCount ==10)jLabel10.setIcon((Icon) ic[icCount]);
    if(icCount ==11)jLabel11.setIcon((Icon) ic[icCount]);
    if(icCount ==12)jLabel12.setIcon((Icon) ic[icCount]);
    if(icCount ==13)jLabel13.setIcon((Icon) ic[icCount]);
    if(icCount ==14)jLabel14.setIcon((Icon) ic[icCount]);
    if(icCount ==15)jLabel15.setIcon((Icon) ic[icCount]);
    if(icCount ==16)jLabel16.setIcon((Icon) ic[icCount]);
    if(icCount ==17)jLabel17.setIcon((Icon) ic[icCount]);
    if(icCount ==18)jLabel18.setIcon((Icon) ic[icCount]);
    if(icCount ==19)jLabel19.setIcon((Icon) ic[icCount]);
    if(icCount ==20)jLabel20.setIcon((Icon) ic[icCount]);
    if(icCount ==21)jLabel21.setIcon((Icon) ic[icCount]);
    if(icCount ==22)jLabel22.setIcon((Icon) ic[icCount]);
    if(icCount ==23)jLabel23.setIcon((Icon) ic[icCount]);
    if(icCount ==24)jLabel24.setIcon((Icon) ic[icCount]);
    if(icCount ==25)jLabel25.setIcon((Icon) ic[icCount]);
    System.out.printf("matDealCount, matcol,matrox, icCount "+" " + matDealCount+" "+matCol+" "+matRow+" "+icCount);
        icCount++;
        if(matDealCount==84){
            icCount=1;
            matRow =0;
            matCol=0;
        matDealCount++;
        if(icCount >25)icCount=1;
        if(matCol <= 14) {
           matCol++;
        if(matCol == 15) {
           matCol = 1;
           matRow++;
           if(matRow ==5 && matRow ==14){
              matRow=0;
              matCol=1;
              matDealCount =1;
              testCardMatrix =1;
        System.out.printf("%n  icCount= "+icCount);
    }   Here is the problem code:
    It performs all these functions and I see nothing until it?s
    over and then I see it all in one shot.
    Button11 starts a for loop
    startshowMatrix
    - showMatrix --displays one card
    - Deck.delayMilli(500);
    return to button 11 for another loop
    Right now the for Loop shows me 3 cards at a time.
    I had the for loop around the startshowMatrix method. No success.
    What I want is showMatrix to display a card in a jLabel, delay, and display the next one.
    Simple? I ?m sure it is?lol
    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        System.out.printf("in button 11");
        for(int i=1; i<4; i++){
         startshowMatrix();
    public void startshowMatrix(){
        showMatrix();
        Deck.delayMilli(500);
    public void showMatrix(){
    ic[icCount] = new ImageIcon(Deck.cardMatrix[matRow][matCol]);
    if(icCount ==1 ) jLabel1.setIcon((Icon) ic[icCount]);
    if(icCount ==2 ) jLabel2.setIcon((Icon) ic[icCount]);
    if(icCount ==3 ) jLabel3.setIcon((Icon) ic[icCount]);
    if(icCount ==4 ) jLabel4.setIcon((Icon) ic[icCount]);
    if(icCount ==5 ) jLabel5.setIcon((Icon) ic[icCount]);
    if(icCount ==6 ) jLabel6.setIcon((Icon) ic[icCount]);
    if(icCount ==7 ) jLabel7.setIcon((Icon) ic[icCount]);
    if(icCount ==8 ) jLabel8.setIcon((Icon) ic[icCount]);
    if(icCount ==9 ) jLabel9.setIcon((Icon) ic[icCount]);
    if(icCount ==10)jLabel10.setIcon((Icon) ic[icCount]);
    if(icCount ==11)jLabel11.setIcon((Icon) ic[icCount]);
    if(icCount ==12)jLabel12.setIcon((Icon) ic[icCount]);
    if(icCount ==13)jLabel13.setIcon((Icon) ic[icCount]);
    if(icCount ==14)jLabel14.setIcon((Icon) ic[icCount]);
    if(icCount ==15)jLabel15.setIcon((Icon) ic[icCount]);
    if(icCount ==16)jLabel16.setIcon((Icon) ic[icCount]);
    if(icCount ==17)jLabel17.setIcon((Icon) ic[icCount]);
    if(icCount ==18)jLabel18.setIcon((Icon) ic[icCount]);
    if(icCount ==19)jLabel19.setIcon((Icon) ic[icCount]);
    if(icCount ==20)jLabel20.setIcon((Icon) ic[icCount]);
    if(icCount ==21)jLabel21.setIcon((Icon) ic[icCount]);
    if(icCount ==22)jLabel22.setIcon((Icon) ic[icCount]);
    if(icCount ==23)jLabel23.setIcon((Icon) ic[icCount]);
    if(icCount ==24)jLabel24.setIcon((Icon) ic[icCount]);
    if(icCount ==25)jLabel25.setIcon((Icon) ic[icCount]);
    System.out.printf("matdealcount, matcol,matrox, icCount "+" " + matDealCount+" "+matCol+" "+matRow+" "+icCount);
        icCount++;
        if(matDealCount==84){
            icCount=1;
            matRow =0;
            matCol=0;
        matDealCount++;
        if(icCount >25)icCount=1;
        if(matCol <= 14) {
           matCol++;
        if(matCol == 15) {
           matCol = 1;
           matRow++;
           if(matRow ==5 && matRow ==14){
              matRow=0;
              matCol=1;
              matDealCount =1;
              testCardMatrix =1;
             // cardNumber=1;
    System.out.printf("%n  icCount= "+icCount);
         public static void delayMilli(long ms)
    //System.out.printf("%n indelay");
    Date d = new Date();
    Date e;
    long cTime = d.getTime();
    long tTime;
    //System.out.printf("%n indelay");
    do
    {e = new Date();
    tTime = e.getTime();
    }while(tTime - cTime <= ms);
    System.out.printf("%n in delay before return");
    return;
    }      JavaLuck

    JavaLuck wrote:
    Read the tutorial. blah blah blah.
    But I understand what I'm dealing with.
    JavaLuck also wrote:
    Threads are turning into my brain into jellyMake up your mind. And don't just read the tutorial, do the exercises. That's what they're there for.
    Your problem is about displaying labels one by one in a delayed fashion, yet you repeatedly post 25 lines of setIcon code which has nothing whatsoever to do with the problem and is also ugly: you should be using an array of JLabel and setting the icons in a loop.
    The class javax.swing.Timer hides the threading details from you and the actionListener method of its assigned Action, as all event code, runs on the EDT.import java.awt.*;
    import java.awt.event.ActionEvent;
    import javax.swing.*;
    import javax.swing.border.LineBorder;
    public class DelayedLabels {
       private JPanel panel;
       private Timer timer;
       void makeUI() {
          panel = new JPanel(new GridLayout(0, 5, 5, 5));
          timer = new Timer(500, new AbstractAction() {
             private int counter;
             @Override
             public void actionPerformed(ActionEvent e) {
                counter++;
                JLabel label = new JLabel(" Card " + counter);
                label.setBorder(new LineBorder(Color.RED));
                label.setPreferredSize(new Dimension(50, 50));
                panel.add(label);
                panel.revalidate();
                panel.repaint();
                if (counter == 25) {
                   timer.stop();
          JFrame frame = new JFrame("Delayed Labels");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(400, 400);
          frame.setLayout(new FlowLayout());
          frame.setLocationRelativeTo(null);
          frame.add(panel);
          frame.setVisible(true);
          timer.start();
       public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
             @Override
             public void run() {
                new DelayedLabels().makeUI();
    }db

  • Lightbox won't display images

    I am using lightbox in dreamweaver and am having a hard time getting the pictures to display on the website. When you click on the image on the website, there is a continuous loading screen for the image. I thought I was having a hard time adjusting the right size of the image, but when I click on live view in dreamweaver, they show correctly. Why does it work in my live view, but not actual website? Am I not connecting it correctly?

    Katie Honas Graphic Design
    Katie Honas Photography
    A couple of my images won't display. I am cropping to make them fit in Photoshop. Is there a way I am saving or cropping them wrong? Thank you!

  • QuickPreview and Preview won't display images

    OK.  We're on a MacPro 5,1 and have been running mountain lion for a week or two now with no issues.  all of a sudden, preview has stopped displaying images when you open them.  The finder window, when in column view, will not display the preview, and hitting spacebar to go into QuickView will just open a blank white screen in the size of the image. Image icons for the pgs do display. Interestingly enough, Screen sharing also is displaying blank white screens. 
    The system config is below:
      Model Name:          Mac Pro
      Model Identifier:          MacPro5,1
      Processor Name:          Quad-Core Intel Xeon
      Processor Speed:          2.8 GHz
      Number of Processors:          1
      Total Number of Cores:          4
      L2 Cache (per Core):          256 KB
      L3 Cache:          8 MB
      Memory:          8 GB
      Processor Interconnect Speed:          4.8 GT/s
      Boot ROM Version:          MP51.007F.B03
      SMC Version (system):          1.39f11
      SMC Version (processor tray):          1.39f11
      Serial Number (system): 
      Serial Number (processor tray):      
      Hardware UUID:          DCB72D90-0983-55C8-AD71-E92CCFD886E4
    We have 2 x ATI Radeon HD 5770 video cards running a total of 3 displays (2 at 1024x768, 1 at 1280 x 1024)
    Any suggestions as to what's gone wrong?

    Try deleting the Finder .plists.
    You need to look in your user Library/Preferences for the .plist. Hold down the option key while using the Finder "Go To Folder" command. Enter ~`/Library. Delete the .plist(s) for the application or move them to your desktop so you can put them back. Since there are several .plists, you may want to try them one at a time You'll need to Force quit Finder to get it to relaunch (command - option- esc).
    If you prefer to make your user library permanently visible, use the Terminal command found below.
    http://osxdaily.com/2011/07/04/show-library-directory-in-mac-os-x-lion/
    You might want to bookmark the command. I had to use it again after I installed 10.8.2. I have also been informed that if you drag the user library to Finder it will remain visible.

  • Won't display image

    Hi, I've been trying to get this code to show an image for quite some time and just don't understand why it isn't. I run the program and it just shows a black square on my marker. Is there something wrong with it?
    package {
        import flash.display.BitmapData;
        import flash.display.Sprite;
        import flash.media.Camera;
        import flash.media.Video;
        import flash.utils.ByteArray;
        import org.libspark.flartoolkit.core.FLARCode;
        import org.libspark.flartoolkit.core.param.FLARParam;
        import org.libspark.flartoolkit.core.raster.rgb.FLARRgbRaster_BitmapData;
        import org.libspark.flartoolkit.core.transmat.FLARTransMatResult;
        import org.libspark.flartoolkit.detector.FLARSingleMarkerDetector;
        import org.libspark.flartoolkit.pv3d.FLARBaseNode;
        import org.libspark.flartoolkit.pv3d.FLARCamera3D;
        import org.papervision3d.lights.PointLight3D;
        import org.papervision3d.objects.primitives.Cube;
        import org.papervision3d.render.BasicRenderEngine;
        import org.papervision3d.scenes.Scene3D;
        import org.papervision3d.view.Viewport3D;
        import org.papervision3d.materials.utils.MaterialsList;
        import org.papervision3d.materials.shadematerials.FlatShadeMaterial;
        import org.papervision3d.materials.BitmapMaterial;
        import flash.events.Event;
        import org.papervision3d.materials.BitmapFileMaterial;
        import org.papervision3d.objects.parsers.DAE;
        [SWF(width="640", height="480", frameRate="30", backgroundColor="#FFFFFF")]
        public class AugReality extends Sprite
            [Embed(source="ice.pat", mimeType="application/octet-stream")]
            private var marker:Class;
            [Embed(source="camera_para.dat", mimeType="application/octet-stream")]
            private var cam_params:Class;
            private var ar_params:FLARParam;
            private var ar_marker:FLARCode;       
            private var ar_vid:Video;
            private var ar_cam:Camera;       
            private var ar_bmp:BitmapData;
            private var ar_raster:FLARRgbRaster_BitmapData;
            private var ar_detection:FLARSingleMarkerDetector;       
            private var ar_scene:Scene3D;
            private var ar_3dcam:FLARCamera3D;
            private var ar_basenode:FLARBaseNode;
            private var ar_viewport:Viewport3D;
            private var ar_renderengine:BasicRenderEngine;
            private var ar_transmat:FLARTransMatResult;
            private var ar_cube:Cube       
            public function AugReality()
                createFLAR();
                createCam();
                createBMP();
                createPapervision();
                addEventListener(Event.ENTER_FRAME, loop);
            public function createFLAR()
                ar_params = new FLARParam();
                ar_marker = new FLARCode(16, 16);
                ar_params.loadARParam(new cam_params() as ByteArray);
                ar_marker.loadARPatt(new marker());
            public function createCam()
                ar_vid = new Video(640, 480);
                ar_cam = Camera.getCamera();
                ar_cam.setMode(640, 480, 30);
                ar_vid.attachCamera(ar_cam);
                addChild(ar_vid);
            public function createBMP()
                ar_bmp = new BitmapData(640, 480);
                ar_bmp.draw(ar_vid);
                ar_raster = new FLARRgbRaster_BitmapData(ar_bmp);
                ar_detection = new FLARSingleMarkerDetector(ar_params, ar_marker, 80);
            public function createPapervision()
                ar_scene = new Scene3D();
                ar_3dcam = new FLARCamera3D(ar_params);
                ar_basenode = new FLARBaseNode();
                ar_renderengine = new BasicRenderEngine();
                ar_transmat = new FLARTransMatResult();
                ar_viewport = new Viewport3D();
                var ar_light:PointLight3D = new PointLight3D();
                ar_light.x = 1000;
                ar_light.y = 1000;
                ar_light.z = -1000;
                var ar_bitmap:BitmapFileMaterial;
                ar_bitmap = new BitmapFileMaterial("hilite.jpg");
                ar_bitmap.doubleSided = true;
                ar_cube = new Cube(new MaterialsList({all:ar_bitmap}), 80, 0, 80);
                ar_scene.addChild(ar_basenode);
                ar_basenode.addChild(ar_cube);
                addChild(ar_viewport);
            private function loop(e:Event):void
                ar_bmp.draw(ar_vid);
                try
                    if(ar_detection.detectMarkerLite(ar_raster, 80) && ar_detection.getConfidence() > 0.5)
                        ar_detection.getTransformMatrix(ar_transmat);
                        ar_basenode.setTransformMatrix(ar_transmat);
                        ar_renderengine.renderScene(ar_scene, ar_3dcam, ar_viewport);
                catch(e:Error){}
    Thanks!

    Thanks again for the response bobo. This did get rid of the error but I'm still just getting a black square and not the image.
    Code again if it helps ----
    package {
        import flash.display.BitmapData;
        import flash.display.Sprite;
        import flash.media.Camera;
        import flash.media.Video;
        import flash.utils.ByteArray;
        import org.libspark.flartoolkit.core.FLARCode;
        import org.libspark.flartoolkit.core.param.FLARParam;
        import org.libspark.flartoolkit.core.raster.rgb.FLARRgbRaster_BitmapData;
        import org.libspark.flartoolkit.core.transmat.FLARTransMatResult;
        import org.libspark.flartoolkit.detector.FLARSingleMarkerDetector;
        import org.libspark.flartoolkit.pv3d.FLARBaseNode;
        import org.libspark.flartoolkit.pv3d.FLARCamera3D;
        import org.papervision3d.lights.PointLight3D;
        import org.papervision3d.objects.primitives.Cube;
        import org.papervision3d.render.BasicRenderEngine;
        import org.papervision3d.scenes.Scene3D;
        import org.papervision3d.view.Viewport3D;
        import org.papervision3d.materials.utils.MaterialsList;
        import org.papervision3d.materials.shadematerials.FlatShadeMaterial;
        import org.papervision3d.materials.BitmapMaterial;
        import flash.events.Event;
        import org.papervision3d.materials.BitmapFileMaterial;
        import org.papervision3d.objects.parsers.DAE;
        [SWF(width="640", height="480", frameRate="30", backgroundColor="#FFFFFF")]
        public class AugReality extends Sprite
            [Embed(source="ice.pat", mimeType="application/octet-stream")]
            private var marker:Class;
            [Embed(source="camera_para.dat", mimeType="application/octet-stream")]
            private var cam_params:Class;
            private var ar_params:FLARParam;
            private var ar_marker:FLARCode;       
            private var ar_vid:Video;
            private var ar_cam:Camera;       
            private var ar_bmp:BitmapData;
            private var ar_raster:FLARRgbRaster_BitmapData;
            private var ar_detection:FLARSingleMarkerDetector;       
            private var ar_scene:Scene3D;
            private var ar_3dcam:FLARCamera3D;
            private var ar_basenode:FLARBaseNode;
            private var ar_viewport:Viewport3D;
            private var ar_renderengine:BasicRenderEngine;
            private var ar_transmat:FLARTransMatResult;
            private var ar_cube:Cube       
    //        private var ar_dae:DAE;//Uncomment for dae
            public function AugReality()
                addEventListener(Event.ADDED_TO_STAGE, onAddToStageHandler);
            private function onAddtoStageHandler(event:Event):void
                createFLAR();
                createCam();
                createBMP();
                createPapervision();
                addEventListener(Event.ENTER_FRAME, loop);
            public function createFLAR()
                ar_params = new FLARParam();
                ar_marker = new FLARCode(16, 16);
                ar_params.loadARParam(new cam_params() as ByteArray);
                ar_marker.loadARPatt(new marker());
            public function createCam()
                ar_vid = new Video(640, 480);
                ar_cam = Camera.getCamera();
                ar_cam.setMode(640, 480, 30);
                ar_vid.attachCamera(ar_cam);
                addChild(ar_vid);
            public function createBMP()
                ar_bmp = new BitmapData(640, 480);
                ar_bmp.draw(ar_vid);
                ar_raster = new FLARRgbRaster_BitmapData(ar_bmp);
                ar_detection = new FLARSingleMarkerDetector(ar_params, ar_marker, 80);
            public function createPapervision()
                ar_scene = new Scene3D();
                ar_3dcam = new FLARCamera3D(ar_params);
                ar_basenode = new FLARBaseNode();
                ar_renderengine = new BasicRenderEngine();
                ar_transmat = new FLARTransMatResult();
                ar_viewport = new Viewport3D();
                var ar_light:PointLight3D = new PointLight3D();
                ar_light.x = 1000;
                ar_light.y = 1000;
                ar_light.z = -1000;
                //Remove for dae
                var ar_bitmap:BitmapFileMaterial;
                ar_bitmap = new BitmapFileMaterial("hilite.jpg");
                ar_bitmap.doubleSided = true;
                //Remove for dae
                ar_cube = new Cube(new MaterialsList({all:ar_bitmap}), 250, 0, 250);
                //Uncomment for dae
    //            var ar_materials:MaterialsList = new MaterialsList({all: new FlatShadeMaterial(ar_light)});
    //            ar_dae = new DAE();
    //            ar_dae.load("lrg_acorn.dae", ar_materials);
    //            ar_dae.scaleX = 5;
    //            ar_dae.scaleY = 5;
                ar_scene.addChild(ar_basenode);
                ar_basenode.addChild(ar_cube);//Remove for dae
    //            ar_basenode.addChild(ar_dae);//Uncomment for dae
                addChild(ar_viewport);
            private function loop(e:Event):void
                ar_bmp.draw(ar_vid);
    //            ar_cube.rotationX +=4;
    //            ar_cube.rotationY +=6;
    //            ar_dae.rotationZ +=4; //Uncomment for dea rotation
                try
                    if(ar_detection.detectMarkerLite(ar_raster, 80) && ar_detection.getConfidence() > 0.5)
                        ar_detection.getTransformMatrix(ar_transmat);
                        ar_basenode.setTransformMatrix(ar_transmat);
                        ar_renderengine.renderScene(ar_scene, ar_3dcam, ar_viewport);
                catch(e:Error){}
    Thanks for helping me get through this bobo, I really appreciate it

  • Won't display Images

    Hey,
    I am making a application to pin point a particular point on a map (as in 1 specific pixel)
    but the problem i have is,before scanning in 6 dozen maps for my uni mate (shes doing geography im doing software enginerring) i am using a plain bmp (its just purple) mad eusing MSPaint (im not running unix.liunix)
    and it wont display the image, but it will display a scanned image and image sobtained off the net,
    why is this??
    this isnt exactly specific to the application i am creating now as it will used scanned images (which work) but for future reference,if you could tell me why, and how to get around it.......
    Drogo

    "catch whatever it is"That code will not compile.
    Please post extracts of the of what you are using, or a Short, Self Contained, Correct (Compilable), Example. I'm fairly sure you will need a JPEG or GIF file, as getImage I'm sure does not support .BMP.
    What did the code I posted above return? (the file exists stuff?) However, I'm sure it is down to the use of a BMP.
    Unless you are targeting an old platform, consider using ImageIO, it supports more formats, and is just spanker than Toolkit.
    Image image;
    try {
        image = ImageIO.read( new File( filename ) );
    } catch( final IOException ioe ) {
       System.err.println( "Failed to load image" );
       ioe.printStackTrace();
    if( image == null ) {
       System.out.println( "Check the file exists, and is the format you think it is" );
    }

  • UILoader won't display images from PHP/MYSQL query

    I'm working on an online photo catalog, it works in straight PHP/HTML http://www.buckleyphotos.com/search/index.php but the photos are too easy to grab (Facebook and myspace are loaded with my photos). I know anything on screen can be grabbed, I just want to make it a little harder.
    I've got a version of the ordering page with a SWF on it that will hopefully display the photos, http://www.buckleyphotos.com/searchtest/showpic.php?num=1&showpic=21_71909_6908.jpg&el=200 9-07-19+NEMX+Crow+Hill&riderno=21, but so far no luck.
    Here's the PHP:
    <?php
    $page = $_GET['num'];
    $el = urlencode($_GET["el"]);
    $riderno = $_GET["riderno"];
    $showPic = strtolower($_GET["showpic"]);
    echo "$showPic";
    ?>
    This is the Actionscript:
    import fl.containers.UILoader;
    var loader:UILoader = new UILoader();
    loader.scaleContent = false;
    loader.source = "showPic.php";
    addChild(loader);
    The SWF is in the same folder as the images.
    Any help will be much appreciated.

    I'm stil woking on this one,
    http://www.buckleyphotos.com/wsp5706/source/image/showpic.php?num=1&showpic=21_71909_6487. jpg&el=2009-07-19+NEMX+Crow+Hill&riderno=21
    Here's the PHP code
    <?php
    $page = $_GET['num'];
    $el = urlencode($_GET["el"]);
    $riderno = $_GET["riderno"];
    $showPic = strtolower($_GET["showpic"]);
    echo "$showPic";
    ?>
    You can see the file name of the photo above the light gray SWF, that's the result of the PHP query, echo "showPic"
    This is the AS 3 code:
    import fl.containers.UILoader;
    var loader:UILoader = new UILoader();
    loader.scaleContent = false;
    loader.source = "showPic";
    addChild(loader);
    This is the HTML:
    <param name="movie" value="http://www.buckleyphotos.com/wsp5706/source/image/Main2.swf">
    <param name="quality" value="high">
    <param name="wmode" value="opaque">
    <param name="swfversion" value="6.0.65.0">
    <param name="expressinstall" value="../Scripts/expressInstall.swf">
    <param name="allowScriptAccess" value="always">
    <param name="loader.source" value="$showPic">

  • Safari won't display image gallery

    I've got this photo gallery which uses swap image rollover
    behavior, and works perfectly fine in FF and IE but safari shows
    only my thumbnails and not the enlarged image. The webpage is up at
    www.windowpromo.com
    Is there a parallel behavior that works on all browsers or is
    this some specific Safari quirk?
    I'd appreciate any help I could get

    I don't have time to check through all the code, but I did
    spot the
    following - which may be the culprit... the use of the word
    'body' for the
    name and id... change that to something else and see what
    happens.
    <div align="center"><img
    src="../Source/transparent.gif" name="body"
    width="535" height="400" id="body">
    Nadia
    Adobe® Community Expert : Dreamweaver
    CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    ~ Customisation Service Available ~
    http://www.csstemplates.com.au

  • Help with a label output. Probably something simple.

    Don't worry about the rest of the code, my problem is that the label will not update after the btOption1 button is clicked.
    Any suggestions?
    // Create the event
        class ButtonListener implements ActionListener
            public void actionPerformed(ActionEvent e)
                if(e.getSource() == btOption1)
                    // Declare variables
                    int intTickets = 0;
                    double dblSurcharge = 0;
                    double dblTotal = 0;
                    String strNum1 = lblFName1.toString();
                    String strNum2 = lblFName2.toString();
                    String strNum3 = lblFName3.toString();
                    String strNum4 = lblFName4.toString();
                    String strOutput = "";
                    // Calculate the amount of tickets sold for the surcharge
                    intTickets = Integer.parseInt(strNum1) + Integer.parseInt(strNum2) + Integer.parseInt(strNum3) + Integer.parseInt(strNum4);
                    // Calculate the surcharge
                    dblSurcharge = 5 * intTickets;
                    // Calculate the total cost
                    dblTotal = dblSurcharge + ((Integer.parseInt(strNum1) * 7.50) + (Integer.parseInt(strNum2) * 6.25) + (Integer.parseInt(strNum3) * 8.75) + (Integer.parseInt(strNum4) * 7.50));
                    //  Convert the double to string
                    strOutput = dblTotal.toString();
                    // Display the total cost of the tickets
                    lblOutput.setText("$" + dblTotal);
        }Edited by: Anonymous23 on Jun 7, 2010 3:05 PM

    import javax.swing.*;
    import java.awt.GridLayout;
    import java.awt.event.*;
    import java.awt.*;
    public class FandangoTickets extends JFrame
        int intTickets = 0;
        int intSurcharge = 5;
        double dblTotal = 0;
        private JButton btOption1 = new JButton("Order");
        private JLabel lblImage = new JLabel(new ImageIcon("Images/Fandango.jpg"));
        private JTextField lblFName1 = new JTextField("0");
        private JTextField lblFName2 = new JTextField("0");
        private JTextField lblFName3 = new JTextField("0");
        private JTextField lblFName4 = new JTextField("0");
        private JLabel lblOutput = new JLabel("$0.00");
        public FandangoTickets()
            setLayout(new GridLayout (7,3,3,3));
            add(new JLabel("Matinee Tickets:"));
            add(new JLabel(""));
            add(new JLabel(""));
            add(new JLabel(""));
            add(new JLabel("Adult Ticket"));
            add(lblFName1);
            add(new JLabel(""));
            add(new JLabel("Child Ticket"));
            add(lblFName2);
            add(new JLabel("Evening Tickets:"));
            add(new JLabel(""));
            add(new JLabel(""));
            add(new JLabel(""));
            add(new JLabel("Adult Ticket"));
            add(lblFName3);
            add(new JLabel(""));
            add(new JLabel("Child Ticket"));
            add(lblFName4);
            add(lblImage);
            add(btOption1);
            add(lblOutput);
        class ButtonListener implements ActionListener
            public void actionPerformed(ActionEvent e)
                if(e.getSource() == btOption1)
                    String strNum1 = lblFName1.toString();
                    String strNum2 = lblFName2.toString();
                    String strNum3 = lblFName3.toString();
                    String strNum4 = lblFName4.toString();
                    String strOutput = "";
                    dblTotal = intSurcharge + ((Integer.parseInt(strNum1) * 7.50) + (Integer.parseInt(strNum2) * 6.25) + (Integer.parseInt(strNum3) * 8.75) + (Integer.parseInt(strNum4) * 7.50));
                    strOutput = Double.toString(dblTotal);
                    lblOutput.setText("$" + dblTotal);
        public static void main()
            FandangoTickets frame = new FandangoTickets();
            frame.setTitle("Fandango Tickets");
            frame.setSize(300,300);
            frame.setLocationRelativeTo(null);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
    }

  • File Explorer won't display image in local HTML file

    I'm studying HTML. I created a file, RECIPE.HTM and in it I have a tag to an image file, HOTDOG.PNG, located in the same folder.  When I open the RECIPE.HTM file, it displays correctly in the browser.  It will not display in the Preview Pane, however.
    It gives me the warning, "Some pictures have been blocked to help prevent the sender from identifying your computer. Open this item to view the pictures."
    Can I enable the preview pane so it will display embedded images in html documents?  I realize that on a live site this might be risky, but my files are all local.  Regardless, I'd like to have the option.

    Hi,
    If you want to get rid of the warning, you must save the complete web page, not just the html. You have 2 options in the Save as... dialog in IE that does this:
    Web page, complete (*.htm;*html)
    This stores the html, and also all related resources (images, css files, js files etc) in a separate folder on your computer.
    Web Archive, single file (*.mht)
    This stores everything inside a single file, that can be read by IE. This stores all resources within the file as binary data.
    You can refer to the link below for more details:
    http://superuser.com/questions/297428/images-blocked-in-windows-explorer-preview-pane-when-viewing-saved-webpages
    Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Roger Lu
    TechNet Community Support

  • Mac Mail 4.5 won't display images

    This is driving me crazy! I've tried to find an answer for this in the posts. It seems that some people out there have had the same problem and haven't found a resolution.
    When I try to read emails from both of my addresses from two different mail servers, the images don't display, I only get a little blue box with a question mark. I have recently completely reloaded the OS and software and the "Display remote images in HTML messages" box is checked. Images do load correctly in Safari if I use my old Earthlink account. They also load correctly in Gmail.
    In addition, I don't seem to have a load images button on the bar between the mail list and the message but I do get it in the spam folder. I can't find anything in preferences that changes that and I'd settle for having that option. What's going on, anyone know? Thanks in advance.

    Some more clarity of differences, if any, between the behavior of the Gmail account, which I presume is IMAP, and the Earthlink which is POP. Or do you have another account?
    With an IMAP account, in Mail Preferences/Accounts/Advanced, if you have selected to Keep copies of messages and their attachments for Offline viewing, then the Load Image button would not be needed or displayed. But in the SPAM folder, the action is to not pre-load those images.
    But any images on remote servers are not attachments, and will not be loaded, but are only links. Therefore you must be connected in good order to view those images. Having the blue question mark is an indication of lack of connectivity to the origin server.
    More info, please.
    Ernie

  • CS4 won't display images

    I just finished installing photoshop, and tried to open an image to edit.
    The image seems to load as there is a tab for it and it is visible in the layers panel,
    but the area where you edit the photo itself remains grey.
    any tips?
    I have updated my video card driver software.

    We just had the identical question with CS3. The image window was off screen.
    He fixed it by resetting preferences but first you could try playing with the Arrange Windows drop down in the top bar.

  • T61 screen won't display images

    My T61 turns on, the backlight comes on, but images do not appear, not even the boot images with the manufacturer's name. If I wait the amount of time it would take to load to the desktop, I can use the keyboard to navigate to My Computer and open the disc drive, but I cannot copy files I navigated to to an external hard drive to back them up. Anything I can do to fix this?

    what is the model number of your T61? what GPU does it use? and did you drop or spill any liquid on the laptop? 
    If it doesn't show any images, how do you navigate to my computer and open the disc drive?
    Also, it would be good that if you can change the location from Earth to the real location of where you live. 
    Regards,
    Jin Li
    May this year, be the year of 'DO'!
    I am a volunteer, and not a paid staff of Lenovo or Microsoft

  • My MAC won't display images from websites, all of a sudden. Any ideas?

    My e-mail works fine and includes pictures, but websites only download text.

    Remove all other plugins you have installed for viewing PDFs and install [https://www.adobe.com/products/reader.html Adobe reader]

Maybe you are looking for