Image not seen in JFrame

I have an applet with a background image and some JButtons.
When you click a button a new Window (JFrame) is opened with some JLabels, JButtons on.
This works fine in Appletviewer. When I run the program in IE the image in the JFrame isn't visible. Since the one in the applet is seen, the path to the images must be right.
I have the image as a JLabel. The buttons and the JLabels with texts are seen, but not the one with the image. What might be wrong?
ImageIcon bild = new ImageIcon("images/"+valdgenre+".jpg");     
JLabel imageLabel = new JLabel(bild);
imageLabel.setSize(415,550);
contentPane.add(imageLabel);

hi,
better to use this:
try
ImageIcon ic = new ImageIcon(getClass().getResource("/images/" + imageName + ".jpg"))
catch (Exception e)
e.printStackTrace();
}Stijn

Similar Messages

  • NetBoot Images not "seen" by MM / MBA when booting with ALT without any local bootable Volumes

    Hello Community!
    I ran into a very odd Problem trying to start Production and Service Mac Minis or Mac Book Airs from our NetBoot Server holding the ALT Key while the Startup Chime sounds. Image selection is working fine if a local Volume is present. When no local bootable Volume is available the Macs will (in 90% of the Cases) stop responding at the point where the Bootpicker should show all available NetBoot Volumes. The dropdown menu for choosing a Wireless Network is popping up but after that the spinning wheel next to it stops and the Mac wont recognize any input from mouse or keyboard.
    The EFI Startup environment is not totally stuck in these cases though, cause sometimes when you restart the NetBoot Service on the Server the NetBoot Volumes will popup on the clients screen.
    If you hold the clients "N" key instead to Start Up from the Servers Default NB Image it works like a charm. Also all the other Mac Models have no problem at all Netbooting using the Bootpicker.
    Among other things I already tried the following:
    - changing NBI index numbers
    - shortening Image names that are sent out by the Server at the BSDP ACK[LIST] step to reduce the packet size
    - deactivating all Netboot Images but one
    - setting up a second netboot Server and transferring half of the Images to it
    the Netboot Log shows that the following client - server communication is repeated over an over:
    Oct 10 16:58:47 macimgsrv.intern bootpd[20296]: DHCP INFORM [en0]: 1,10:dd:b1:ea:d1:e5
    Oct 10 16:58:47 macimgsrv.intern bootpd[20296]: ACK sent <no hostname> 192.168.2.112 pktsize 300
    Oct 10 16:58:48 macimgsrv.intern bootpd[20296]: BSDP INFORM [en0] 1,10:dd:b1:ea:d1:e5 NetBoot1271 arch=i386 sysid=Macmini6,1
    Oct 10 16:58:48 macimgsrv.intern bootpd[20296]: NetBoot: [1,10:dd:b1:ea:d1:e5] BSDP ACK[LIST] sent 192.168.2.112 pktsize 364
    Oct 10 16:58:48 macimgsrv.intern bootpd[20296]: DHCP INFORM [en0]: 1,10:dd:b1:ea:d1:e5
    Oct 10 16:58:48 macimgsrv.intern bootpd[20296]: ACK sent <no hostname> 192.168.2.112 pktsize 300
    Oct 10 16:58:53 macimgsrv.intern bootpd[20296]: BSDP INFORM [en0] 1,10:dd:b1:ea:d1:e5 NetBoot1271 arch=i386 sysid=Macmini6,1
    Oct 10 16:58:53 macimgsrv.intern bootpd[20296]: NetBoot: [1,10:dd:b1:ea:d1:e5] BSDP ACK[LIST] sent 192.168.2.112 pktsize 364
    As a next step I thought of transfering DNS, DHCP and NAT Services to another Machine, although i dont know if that will help.
    If you had the same problem or know anything that might help to solve it, i would be very happy if u share your knowledge with me
    as i am starting to get insane on this one
    thank you in advance,
    Colin Andrew

    Hello Community!
    I ran into a very odd Problem trying to start Production and Service Mac Minis or Mac Book Airs from our NetBoot Server holding the ALT Key while the Startup Chime sounds. Image selection is working fine if a local Volume is present. When no local bootable Volume is available the Macs will (in 90% of the Cases) stop responding at the point where the Bootpicker should show all available NetBoot Volumes. The dropdown menu for choosing a Wireless Network is popping up but after that the spinning wheel next to it stops and the Mac wont recognize any input from mouse or keyboard.
    The EFI Startup environment is not totally stuck in these cases though, cause sometimes when you restart the NetBoot Service on the Server the NetBoot Volumes will popup on the clients screen.
    If you hold the clients "N" key instead to Start Up from the Servers Default NB Image it works like a charm. Also all the other Mac Models have no problem at all Netbooting using the Bootpicker.
    Among other things I already tried the following:
    - changing NBI index numbers
    - shortening Image names that are sent out by the Server at the BSDP ACK[LIST] step to reduce the packet size
    - deactivating all Netboot Images but one
    - setting up a second netboot Server and transferring half of the Images to it
    the Netboot Log shows that the following client - server communication is repeated over an over:
    Oct 10 16:58:47 macimgsrv.intern bootpd[20296]: DHCP INFORM [en0]: 1,10:dd:b1:ea:d1:e5
    Oct 10 16:58:47 macimgsrv.intern bootpd[20296]: ACK sent <no hostname> 192.168.2.112 pktsize 300
    Oct 10 16:58:48 macimgsrv.intern bootpd[20296]: BSDP INFORM [en0] 1,10:dd:b1:ea:d1:e5 NetBoot1271 arch=i386 sysid=Macmini6,1
    Oct 10 16:58:48 macimgsrv.intern bootpd[20296]: NetBoot: [1,10:dd:b1:ea:d1:e5] BSDP ACK[LIST] sent 192.168.2.112 pktsize 364
    Oct 10 16:58:48 macimgsrv.intern bootpd[20296]: DHCP INFORM [en0]: 1,10:dd:b1:ea:d1:e5
    Oct 10 16:58:48 macimgsrv.intern bootpd[20296]: ACK sent <no hostname> 192.168.2.112 pktsize 300
    Oct 10 16:58:53 macimgsrv.intern bootpd[20296]: BSDP INFORM [en0] 1,10:dd:b1:ea:d1:e5 NetBoot1271 arch=i386 sysid=Macmini6,1
    Oct 10 16:58:53 macimgsrv.intern bootpd[20296]: NetBoot: [1,10:dd:b1:ea:d1:e5] BSDP ACK[LIST] sent 192.168.2.112 pktsize 364
    As a next step I thought of transfering DNS, DHCP and NAT Services to another Machine, although i dont know if that will help.
    If you had the same problem or know anything that might help to solve it, i would be very happy if u share your knowledge with me
    as i am starting to get insane on this one
    thank you in advance,
    Colin Andrew

  • Has anyone seen this Dyld Error Message:   Library not loaded: /System/Library/PrivateFrameworks/iLifeSlideshow.framework/Versions/A/iLifeSlid eshow   Referenced from: /Applications/iPhoto.app/Contents/MacOS/iPhoto   Reason: image not found

    Getting this error on iPhoto open it refers to iLifeSlideShow and iPhoto quits - or doesn't open.
    Dyld Error Message:
      Library not loaded: /System/Library/PrivateFrameworks/iLifeSlideshow.framework/Versions/A/iLifeSlid eshow
      Referenced from: /Applications/iPhoto.app/Contents/MacOS/iPhoto
      Reason: image not found

    Yes, some perople have seen this. Options:
    1. Try reinstall iPhoto. (see below)
    2. If you have access to another Mac with the same version of the OS, try and copy that framework over
    3. Reinstall the OS.
    To re-install iPhoto
    1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
    2a: On 10.5:  Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
    2b: On 10.6: Those receipts may be found as follows:  In the Finder use the Go menu and select Go To Folder. In the resulting window type
    /var/db/receipts/
    A Finder Window will open at that location and you can remove the iPhoto pkg files.
    3. Re-install.
    If you purchased an iLife Disk, then iPhoto is on it.
    If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
    If you purchased it on the App Store you can find it in your Purchases List.
    Regards
    TD

  • My iphone4 is not seen on itunes. When I plug the iphone the device does not recognize it but the pc recognizes it as a camera or something. What can I do?

    My Iphone is not seen on itunes when I plug it. I've tried everything that I found on the internet. but it still doesn't work, so I can't sync my iphone. What can I do? I have checked all the USB ports, I have desinstalled and installed again itunes, and I have run out of ideas.

    When you plug it it, it should recognize it as an Apple IPHONE under devices. It will then bring the Camera/Connection wizard for the photos on the device. When you plug into different USB, it should bring the hardware wizard and tell you what its installing, what happens?
    Under Device Manager, under Imaging Devices it will show up as Apple IPHONE. Is this being shown in your computer?

  • Images not visible in epubs in Ibook

    Hi.
    I try to create an epub containin lots of images. All the images are of maximum size 500*500.
    When trying to view the epub in ipad, a few of the images are not seen. Only their captions are visible.
    But when I double tap the place where the images should be actually present, the images open fine in full screen.
    At times, the imae just appears for one second and then vanishes.
    Has anybody faced similar issues? All imaes I use are jpg files.
    Any help in this regard will be greatly helpful.

    By George, that did it! I had regenerated previews, but I missed the main issue.
    Why would thumbnails disappear like that?
    Thanks for your help.
    Steve

  • Likely bug with external editing (in CS5 not CS6 beta) and edited image not showing back up in LR

    I have come across something strange today that I've not seen before. I'm running LR 4.0 under Win7 64-bit. I usually use Photoshop CS6 beta as my external editor, but invoke CS5 when I have to use some tools that don't support the beta. Here is the scenario:
    * I have CS5 open
    * I externally edit an image in CS5 and Save it from CS5 when I'm done
    * The edited image does not show up in LR
    * I close LR and reopen it
    * There is the edited image!
    I have duplicated this many times this evening. I don't think I've seen it when I've used CS6 beta.

    Something strange is going on because I had the behavior reported of edited image not showing up after using another filter, Nik Silver Efex Pro 2.

  • LR 4.1 RC2 appears to be adding 1 - 2 stops to the exposure of some B+W images. Seen Elsewhere?

    I have had to correct about 15 of the B+W  images loaded on flickr. Oddly not all were affected.
    http://www.flickr.com/photos/thevibrantimage
    I allowed the "update process" to 2012 to run on all my images. Maybe it was that? I have not seen any problems on colour images.

    Yes, updating from PV2010 to 2012 tries to preserve the look, but is not
    guaranteed to be a perfect match. The underlying algorithms are too
    different.

  • My pictures folder for iphoto is not seen anywhere..

    my pictures are not seen anywhere on my computer. it seems to be missing in a folder or the folder was deleted i am not too sure. when i go to my name computer and go to pictures the only option is the iphoto recovered photos library and not the iphoto library itself. i hope not to have to redownload this since i have over 5,000 photos in my library. hope you can help

    This one's more up to date - and pretty pictures too...
    With iPhoto 7 (iLife 08) the old iPhoto Library Folder is now a Unix Style Package File. The change was made to the format of the iPhoto library because many users were inadvertently corrupting their library by browsing through it with other software or making changes in it themselves.
    There are many, many ways to access your files in iPhoto:
    For 10.5 users: You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Apple-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. If you're using Gmail you can use THIS
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto. With 10.5 you can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    Or, if you want to access the files with iPhoto not running, then create a Media Browser using Automator (takes about 10 seconds) or use THIS
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.
    Regards
    TD

  • Using ITunes Tutorials will not play.  Using windows XP.  All software up to date.  I know others have had the same issue, however I have not seen a solution.  I appreciate any advice.

    iTunes Tutorials iwll not play.   Using windows XP.  All software up to date.  I know others have had the same issue, however I have not seen a solution.  I appreciate any advice.

    I have traced the problem to a corrupted profile.  When I captured the images in question, I also used Color Cherckr to create a profile for processing.  When I apply that profile to the adjustments I make, I can no longer "Edit In".  If I use another profile, even one that I created using Color Checkr at a different point in time, I don't have the issue.  Something seems to have corrupted the new profile.  I will re-create the profile and see if the issue is resolved.

  • Images not removed from memory after being disposed of

    I am trying to load an image, take a thumbnail of the image, store the thumbnail in an arraylist and then discard the image before moving on to the next one.
    Here is some compilable sample code. it brings up a open file dialog. select a few images and watch as the memery usage goes through the roof (make sure they are decent size, i am using 1600x1200)
    I think the reason it is not working is because the image isnt being flushed after the thumbnail is taken as there is still a reference to it in mem.
    any body any ideas?
    <code>
    import java.awt.Image;
    import java.io.File;
    import java.util.ArrayList;
    import javax.imageio.ImageIO;
    import javax.swing.ImageIcon;
    import javax.swing.JFileChooser;
    import javax.swing.JOptionPane;
    public class Thumbnail {
    public Thumbnail(){
    File[] files;
    int i=0;
    ArrayList list = new ArrayList();;
    JFileChooser fc = new JFileChooser("C:/");
    fc.setMultiSelectionEnabled(true);
    int returnVal = fc.showOpenDialog(null);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
    files = fc.getSelectedFiles();
    for(i=0; i<files.length; i++) {
    list.add(openImage(files));
    JOptionPane.showMessageDialog(null, "Added " + i + " images", "Done", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    public ImageIcon openImage(File file){
    Image tempImage = null;
    try{
    tempImage = ImageIO.read(file);
    } catch (Exception e){}
    return new ImageIcon(tempImage.getScaledInstance(-1, 100, 0));
    public static void main(String[] args) {
    new Thumbnail();
    </code>
    thanks
    kevin

    With ImageIO, you can set subsampling rates and never create that original monster image:
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class AllThumbs {
        public static void main(String[] args) throws IOException {
            URL url = new URL("http://www3.us.porsche.com/english/usa/carreragt/modelinformation/experience/desktop/bilder/icon3_1600x1200.jpg");
            BufferedImage[] images = new BufferedImage[2];
            images[0] = readSubsampling(url.openStream(), url.getPath(), 240);
            images[1] = ImageIO.read(url);
            displayImages(images, new String[]{"thumbnail","original"});
        public static BufferedImage readSubsampling(InputStream in, String suffix, int maxSize) throws IOException {
            ImageReader reader = getReader(suffix);
            reader.setInput(ImageIO.createImageInputStream(in), true, true);
            ImageReadParam param = reader.getDefaultReadParam();
            int size = Math.max(reader.getWidth(0), reader.getHeight(0));
            int subsampling = size/maxSize + (size%maxSize != 0 ? 1 : 0);
            param.setSourceSubsampling(subsampling, subsampling, 0, 0);
            BufferedImage image = reader.read(0, param);
            System.out.println("Size = " + size + ", maxSize = " + maxSize + ", w = " +
                image.getWidth() + ", h = " + image.getHeight());
            reader.dispose();
            return image;
        public static ImageReader getReader(String path) throws IOException {
            String suffix = getSuffix(path);
            Iterator readers = ImageIO.getImageReadersBySuffix(suffix);
            if (!readers.hasNext())
                throw new IOException("No reader for suffix " + suffix);
            ImageReader reader = (ImageReader) readers.next();
            if (readers.hasNext())
                System.out.println("(There are more readers for suffix " + suffix + " )");
            return reader;
        public static String getSuffix(String path) throws IOException {
            int dotIndex = path.lastIndexOf('.');
            if (dotIndex == -1)
                throw new IOException("Suffix not found for " + path);
            return path.substring(1 + dotIndex);
        public static void displayImages(BufferedImage[] images, String[] titles) {
            JFrame f = new JFrame("total #images = " + images.length);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            Box imagePanel = Box.createVerticalBox();
            for(int i=0; i<images.length; ++i) {
                JLabel label = new JLabel(new ImageIcon(images));
    label.setBorder(BorderFactory.createTitledBorder(titles[i]));
    imagePanel.add(label);
    f.getContentPane().add(new JScrollPane(imagePanel));
    f.setSize(450, 400);
    f.setLocationRelativeTo(null);
    f.setExtendedState(Frame.MAXIMIZED_BOTH);
    f.setVisible(true);

  • Ipod not seen by windows or itunes

    Hello, I'm totally frustrated and have been searching for hours. Please someone help.
    - Nano 8 gb
    - Windows xp
    Neither Windows (my computer) nor Itunes sees my ipod. Ipod is working fine: did the menu/select thing, cable is good.
    When I plug the ipod in the usb port I hear a bleep and I get a message bottom right "new hardware found ipod"and the icon is a usb cable. Ipod is not in My computer window. Ipod is not seen by Itunes
    Tried Device Manager/I see Ipod with a ? Yellow. If i right click on it and do update driver the ms computer management system crashes and sends error report.
    I tried dowloading the USB driver and placing it in the directory, but I got stuck because there is no windows/inf directory. I tried to update the usb driver with the same ms crash.
    I'm completely frustrated, please can someone help me.

    I was having the same problem the other day. I'm not sure what it was but I think it has something to do with the i tunes and i pod 1.2 update.
    What I did was:
    1. Uninstall i tunes
    2. Restart my computer
    3. pluged my ipod in a slow usb line
    4. waited until my pc recognized it in there. It took a little while.
    5. re installed i tunes from apple.com
    6. waited until i tunes recognized my ipod
    7. updated my i pod with my library it took a long time because i was in the slow usb plug.
    8. re plugged my ipod into a 2.0 usb line
    9. i tunes recognized it.
    10. I then updated my ipod to the new 1.2 version
    11. The problem started happening again
    12 I repeated what I did before and now it is working.
    It was very frustrating! I hope it works for you.1

  • 5th Gen IPOD - Won't Sync and Not Seen by Windows

    Help!!!
    Tried the 5 R's. I have the IPOD in Disk Mode but whilst it will happily charge, it still is not seen by ITunes or Windows Explorer (though is visible inDisk Defragmenter). I have already un-installed and re-installed ITunes etc.
    Prior to putting it into Disk Mode the IPOD still had my library on it and owuld happily work.

    Have you had a chance to look at these troubleshooting pages? They may be of some help:
    iPod missing in My Computer and in iTunes
    iPod is not recognized properly by computer when USB drivers are not installed properly or are out of date
    If you are using a laptop, this page might help: iPod not recognized when connected to Windows laptop over USB

  • IPod touch: Seen by XP, not seen on OSX.

    Strange one.
    1st Gen ipod Touch with latest software(think its 3.3), latest version of itunes.
    Its seen and works perfect with Windows XP.
    I plug it into my Mac Book Pro, running Lion and its not seen. nothing happens wihen i plug it in.
    I have reset, restored and wiped the ipod from the device itself and its still not seen.
    I also tried it on a Win 7 machine and its NOT seen either.
    Is this something crazy to do with 32bit architecture. Its seen on Win XP which is 32 but not by  64bit Lion and Win 7.
    Any suggestions?

    Have a Look Here
    Device Not Recognised
    For PC
    http://support.apple.com/kb/TS1538
    For Mac
    http://support.apple.com/kb/ts1591

  • HT4356 My iPad does not find the printer. I have tried the HP app and it works, but in any other app the printer is not seen. How do I get this printer visible to the iPad. All my other network computers find and print with out a problem.

    My iPad does not find the printer. I have tried the HP app and it works, but in any other app the printer is not seen. How do I get this printer visible to the iPad. All my other network computers find and print with out a problem.

    hi
    could you tell us what the other app is please

  • Attachments and history of my emails are not seen by Windows users

    attachments and history of my emails are not seen by Windows users

    Just guessing at what you mean, try this:
    In Mail, while composing a message, go to Mail's menu and click:
    Edit > Attachments > Always send Windows-friendly attachments

Maybe you are looking for

  • Can't watch Netflix after upgrading to Yosemite

    I have a MacBook Air, with 4gb, and 2.3 gHz. After I upgraded to Yosemite Netflix stopped working. It gives me an error saying that the "external monitor" is not HD compliant. Have anyone encountered this problem? Have you found a solution? Thanks.

  • I have a iphone4 and a ipad2 and i use 2 laptops to sync them individually, but i used the same apple account. Now I have lost one laptop.

    Hey everyone. I have an iphone4 and an ipad2. I used to sync my phone with one computer and the ipad with another. but i used the same apple account. Now the problem is that i lost the computer to which i was syncing the iphone. Is there a way that i

  • 2007 Macbook Pro, Wireless connection slows to a crawl or drops out!

    Hi all, I have recently started having problems with my 2007 15" 2.16ghz Macbook Pro and the wireless connection to my router. Quite often it will say I am not connected to the network, the Airport symbol will fluctuate between full bars and no bars

  • MM module,Purchase order

    HI experts, I can call 'BAPI_PO_GETITEMS' to get all items in a PO#. Now I have some question. 1. I can get vendor number (HEADERS-VENDOR). how to get vendor name? 2. I get some articlenum in that PO#. Now I want to get UPC/pack/size of every article

  • About Alert

    Hi All I have done JDBC to Proxy scenario i.e. Oracle to BI I am picking up a data from Oracle and sending to BI tables. The thing is when i execute the scenario i can see a success message in XI Moni, means the data got picked up from oracle. Now i