Image is Flickering----Please help

I have one hand image. I am drawing polygon above each finger.
Whenever the user clicks on particular finger, we are changing the color of that polygon.
We are changing the colors of the fingers(polygons) based on the database value when some functionalty is invoked. We are updating this color in PaintComponent of JPanel. The colors are flickering some time.
Please help.
Thanks in Advance.

For drawing your component the best of all would be using Canvas component and double buffering.
JPanel and othen Swing components using its own methods for paint and not necessarily draw components how would you like.
Example:
<code>
class MyPainter extends Canvas {
Image hand = ...;
public void update(Graphics g) {
this.paint(g);
public void paint(Graphics g) {
Dimension size = this.getSize();
Image painter = createImage(size.width, size.height);
Graphics g2 = painter.getGraphics();
g2.drawImage(hand, 0, 0, this);
g2.drawPoligon(...);
g.drawImage(g2, 0, 0, this);
</code>
If you make applet you must cleat graphics g2 and image painter.

Similar Messages

  • I have an ibook g4 laptop and i cant add   music frommy library to my ipod touch but my ipod shows up on image capture ? please help immiedeatly

    i have an ibook g4 laptop and i cant add   music from my library to my ipod touch4 but my ipod shows up on image capture ? please help immiedeatly

    What OS is on the iPod?
    What version of iTunes is on the computer
    Try using iTunes 10.6.3

  • I can't open an image in Firefox, please help..

    I am using Firefox 11 UK edition on a HP Laptop running Windows 7.
    I like to view images in FF instead of Micro-craps image viewer programs. Until recently I had no problem with that. I would right click on the image and select open with FF. Today all of a sudden it wont do it.
    Today when I right click FF is not an option. When I do the browse thing and choose the program manually nothing happens at all.
    I mean nothing at all, its like windows doesn't see FF at all. It is very frustrating.
    The image will then open in MS Image Viewer.
    What is so off is it will allow me to use ANY other program even programs that not designed for it. (I will just get an error of course when it tried to open).
    It almost appears as though MS has done something to purposely not allow FF to do this.
    Please help!

    do a reinstall on firefox

  • Pixelated images in safari, please help.

    Hi everyone,
    Hoping someone can help me with a issue i have with my new macbook pro.
    When browsing the net, safari and firefox show really pixelated images. I thought it might be my internet connection compressing data or something, but i have tried other computers on the same internet connection and the images show perfect...
    So this makes me think its the macbook. I have upgraded snow leopard from 10.6 to 10.6.2 and updated safari, but unfortunately this didnt help my problem. So now i have ended up here, asking you people, coz im out of ideas.
    I will include some screen shots so you can see exactly what i mean.
    Notice the bad quality images and even on google's banner it is pixelated heaps...
    Please help if you can. Its very annoying. Cheers.
    screenshots
    http://i134.photobucket.com/albums/q93/Bonustokin/randon/Screenshot2010-02-13at1 00814PM.png
    http://i134.photobucket.com/albums/q93/Bonustokin/randon/Screenshot2010-02-13at1 00814PM.png

    Yes, I see the big ugly squares. They are what appears whenever extremely heavy JPEG compression is applied to a low-resolution image tht has relatively large areas of similar colors. Something somewhere is applying such compression to the pages, or portions of them, that you are viewing in your browser(s). Your MBP is not doing that: it can't. Either the page images (or parts of them) are being compressed by the website owners or, if every web page is affected, they are being compressed by your ISP in the process of being transmitted to you, as Gordito suggests. That would greatly increase the speed of page loading, but at the expense of image quality. You wouldn't see the image degradation on an iPhone or cell phone — the screen is too small — but on the MBP's high-resolution display it would be much more apparent, IF the MBP were receiving the signal in the same highly compressed form as the phone. If the MBP receives the same web pages through an ISP that doesn't over-compress them, they'll look the way they ought to look. So if you are receiving these web pages through a cellular ISP rather than through a broadband connection, take the MBP to a wifi hotspot and connect through wifi instead. I bet things will look different then.
    Compressing images is something a web browser can't do: a browser just displays the signal that comes to it.

  • Text editable in images in flash Please help

    Hello
    Dear All Friends
    I want to make text editable in images in flash to get copy from text
    can i Make this
    and other question please
    can i convert text in image in flash to normal string ?
    please help
    Thank you

    Images do not store text data in any isolateable manner, it is comprised of just pixels like anything else in the image.  You would need to develop some form of complicated text recognition program to be able to extract text from an image, and I don't believe anyone has.

  • Cannot make image copy. Please Help

    Hi,
    I am trying to make a image copy for the patch 110930-03 because i am getting the error
    Warning:ACPI tables not in reclaim memory
    prom_panic:kmem_free block already free
    Entering boot debugger
    [12ff05]
    Below is the command i am giving.
    C:\>dd S28DCA0301 A:
    S28DCA0301: No such file or directory
    I downloaded the zip file and then extracted it on a windows 2000 server.
    PLEASE HELP.
    Thanks
    Anurag

    Could be a problem with windows 8.3 filenames. Does it
    work if you pass dd the "short" filename associated with
    S28DCA0301? (The explorer properties dialog should list
    the MS-DOS "short" filename).

  • Windows 7 image restore issues (Please help!!!!)

    I backed up my Windows 7 partition to an external hard drive, deleted my Boot Camp partition, and made a new, bigger one. I then booted from the Windows 7 install DVD and went to restore the image to the drive, but it refuses to do so without wiping the entire disk. Someone please help me; I really need Windows back, and really don't want to go through the pain of reinstalling!
    -macfanboy

    It sounds like you are saying your rerun of bootcamp did not create a partition? Maybe run it again? give it the Install for restart with eexternal connected?
    The external backup you made had to be an Image Backup which is ~= to your (C: etc.) drive space and takes 1/2 to 1 hour to backup and to restore.
    1.Insert the installation disc or system repair disc.
    2.Restart your computer using the computer's power button.
    3.If prompted, press any key to start the computer from the installation disc or system repair disc - (You can select it from Option key start up)
    4.Choose your language settings, and then click Next.
    5.Click Repair your computer.
    This step only applies if you are using a Windows installation disc.
    Windows searches for external image
    6.Select a recovery option, and then click Next.
    http://windows.microsoft.com/en-us/windows7/Restore-your-computer-from-a-system- image-backup

  • Creating PDF files from Quark causes font/image issues. PLEASE HELP.

    After creating a PDF file using Adobe Acrobat Professional (using the file>Export to PDF option) from QuarkXPress version 7.3, my client sees and prints distorted letters with various fonts and they even sometimes see lines where they shouldn't be. I don't see these issues on my end, even when I print the documents. For example, I may have a headline of four words, the top of the words are shifted to one side, or sometimes even the top half of the letters are in a different color. Please help soon before I lose my clients... or my mind. Thanks.

    We don't use Quark anymore, but I seem to remember that the export to pdf does not use Acrobat Distiller. It is Quark's own pdf maker. If the customer does have Acrobat Professional, then get them to print to the Adobe PDF 'printer' and seeif they get the same problem. They may need to open the Distiller app to set which output settings are used.

  • Uploading images with jsp-PLEASE HELP

    Hi
    I would like to allow users to upload images(photos) from the website im doing.
    i was gonna use perl which seems quite easy. Since everything else i used was jsp i thought i might try to do uploader in jsp (though its seems more difficult)
    id like to limit :
    the maximum file size to be uploaded ,
    the maximum width/height of the image file
    the list of the acceptable mime-types (Content-Types) -jpg, gif
    Any suggestions how to go about it PLEASE- ie. what packages, classes do i need- mimeparser, BufferedImage, FileFilter? cos im bit lost which classes to use.
    THANKS LOTS
    sabcarina

    This is the jsp File which helps me to upload the file
    But for this Jakarta Commons fileupload is needed which is normally provided with Tomcat 5.5
    The code is
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="org.apache.commons.fileupload.DiskFileUpload"%>
    <%@ page import="org.apache.commons.fileupload.FileItem"%>
    <%@ page import="java.util.List"%>
    <%@ page import="java.util.Iterator"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.io.File"%>
    <%@ page import="com.common.*"%>
    <!--<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Process File Upload</title>
    </head>-->
    <%
         DerivedLastNoEntity objLastNoEntity=new DerivedLastNoEntity();
         DerivedLastNoObject objLastNo=(DerivedLastNoObject)objLastNoEntity.getData(new DerivedLastNoObject(10)).get(0);
         int lastNo=objLastNo.getLastNo();
         String forwardString=null;
         StringBuffer parameters=new StringBuffer();
            DiskFileUpload fu = new DiskFileUpload();
            // If file size exceeds, a FileUploadException will be thrown
            fu.setSizeMax(1000000);
            List fileItems = fu.parseRequest(request);
            Iterator itr = fileItems.iterator();
            while(itr.hasNext()) {
              FileItem fi = (FileItem)itr.next();
              //Check if not form field so as to only handle the file inputs
              //else condition handles the submit button input
              if(!fi.isFormField()) {
              String fileName=fi.getName();
              if(fileName.length()>0)
                   fileName=(++lastNo)+fileName.substring(fileName.lastIndexOf("."));
                   File fNew= new File(application.getRealPath("/"), fileName);
                   parameters.append("&fileName=/struts-blank/"+fileName);
                   fi.write(fNew);
         else
              if(fi.getFieldName().equals("forwardString"))
                   forwardString=fi.getString();
              else
                   parameters.append("&"+fi.getFieldName()+"="+fi.getString());
         objLastNo.setLastNo(lastNo);
         objLastNoEntity.edit(objLastNo);
         System.out.println("before "+forwardString);
         if(parameters.length()>0)
              if(forwardString.indexOf("?")<0)
                   forwardString=forwardString.concat(parameters.toString().replaceFirst("&","?"));
              else
                   forwardString=forwardString.concat(parameters.toString());
         System.out.println("after "+forwardString);
         response.sendRedirect(forwardString);
    %>
    <!--<body>
    Upload Successful!!
    </body>
    </html>-->Bye for now
    CSJakharia

  • Recommended image specifications. Please help?

    Hello all.
    Could anyone please enlighten me to the best practice image specifications for Multi-Touch books made through iBooks Author? I've looked through the iBookstore Asset Guide and iBooks Author support but can't find anything that specifically applies to .iBooks, just EPUBs. I see that, there, the maximum is 2 million pixels, but does this still apply to .iBooks?
    The iPad with Retina's resolution is 2048x1536 (over 3 million pixels), so surely it wouldn't make sense to restrict iBook images in such a way?
    Any knowledge welcome.

    There could be better verbiage, I agree.
    In iBooks Author, the first page is captured and used as the 'cover' automatically when using it's Publish to the store menu, then handed off to iTunes Producer, where you can use it as-is, or change to something else if you desire. If you change it, you need to be aware of the specs (see blurb below)
    If you create a standard epub, say from Pages, and then use iTunes Producer, adding cover art is manual.
    From iTunes Producer:
    These finer points for covers are covered in multiple areas, ranging from several existing threads here to the blurb to the iTunes Producer Guide to Apple tech notes, and this email from Apple last year which the helpful Apple staffer doubtlessly quoted:
    Cover Images
    We are changing the minimum size for cover images. Cover images should now be 1400 pixels wide, in the RGB color space, and delivered as JPEG files. The new minimum size for cover images will be a requirement starting this August. Books already available on the iBookstore do not need to be redelivered.

  • No images on Mac: please help me!

    Hi all,
    I've the following problem: my java application (that is all written in awt to be used with Windows jview) run perfectly under windows but when I try to execute it on a Mac (with mac OS 9 with java 1.3.1) the images (all gif or jpeg) aren't displayed.
    I use the following class to represent draw the image:
    public class IconLabel extends Label {
    private Image image;
    public IconLabel() {
    super();
    public void setImage(Image img){
    this.image= img;
    public void paint(Graphics g){
    int height = this.image.getHeight(this);
    int width= this.image.getWidth(this);
    g.drawImage(this.image,0,0,this);
    this.setSize(width+5,height+5);
    public void update(Graphics g){
    int height = this.image.getHeight(this);
    int width= this.image.getWidth(this);
    g.drawImage(this.image,0,0,this);
    this.setSize(width+5,height+5);
    public void repaint(){
    int height = this.image.getHeight(this);
    int width= this.image.getWidth(this);
    Graphics g=this.getGraphics();
    g.drawImage(this.image,0,0,this);
    this.setSize(width+5,height+5);
    public int getHeight() {return this.image.getHeight(this);}
    public int getWidth() {return this.image.getWidth(this);}
    Anyone could help me?
    Thx inn advance

    Here is the code where I load it:
    private Image image1;
    private IconLabel label1 = new IconLabel();
    this.image1 = toolkit.getImage("images/image1.gif");
    label1 .setImage(image1 );
    then I simply add it to a Panel.
    Thank you.

  • Spaces between images on header - please help!

    I’m having an issue with a layout that I can’t seem to figure out. Here’s the website where the layout looks fine: www.sincityknitshop.com   All I did was add an additional navigation link (testimonials) and it started leaving a space between each image on the header ONLY when I added the rollover navigation buttons.  It was fine if I just inserted the navigation buttons as an image and not a rollover.    http://www.sincityknitshop.com/test2.htm  If I just insert the “off” button as a regular image (no rollover) it looks fine: http://www.sincityknitshop.com/test3.htm  In case it looks fine on your pc, here is a snippet image: http://www.sincityknitshop.com/images/mess.jpg   Does anyone know why it’s doing this??? I’m not doing anything different than what I did on the original layout that is now on her website www.sincityknitshop.com that looks fine.   What's weird is it looks fine on my ipad.   Thanks!!  Any help would be greatly appreciated.

    Nancy O. wrote:
    I think you would be so much better off using CSS styled text links for your rollover menus.  Plus, you could get rid of that awful MM rollover code which clearly isn't working correctly when you mouse over test2.
    I agree with that 100%. In my experience, I've twice been forced to use images in place of text for navigation menus, simply to keep the original design of the site intact. I made my own way around it, and it was "bulky" from a CSS standpoint, but it did have the advantage of the menu still looking like text to search engine crawlers.
    First thing I did was apply a text-indent property of -10000px to my navigation menu list items (#navmenu ul li a{ text-indent:-10000px;}). This keeps the text links off the page when viewed in a browser. Next, I applied a different ID to each <li> in my nav menu list, and applied a normal state (#navmenu ul li a#home) and a hover state (#navmenu ul li a#home:hover) using the image link as a background image with an "on" and an "off" version of each image for each state. Then I built my navigation menu in a <ul> just as I normally would with the proper ID for each <a> list item. It reads just like a regular text menu in the HTML. If you have a lot of items in your menu it can get a little long in the CSS, but it works without "that awful MM rollover code" as Nancy so accurately puts it.

  • Problem: codebase, jar and image reloading problem please help!

    Hi Java Gurus,
    I have written an applet that extends JApplet for viewing webcam. In order to reduce the download time I put my classes into a doorcam.jar file. The following is my <applet> tag in my html file.
    <applet code="CameraApplet.class"
    archive="doorcam.jar"
         codebase = "webcam/classes"
         width="375" height="475">
    <param name="imagePath" value="http://judge/webcam/images">
    <param name="webCamImage" value="door.jpg">
    <param name="COMPort" value="COM2">
    <param name="frameRate" value="10"> <!-- could not exceed more than 10-->
    <param name="host" value="judge">
    </applet>
    The fist problem is that my class file does not get loaded from the jar file if i provide the "codebase" attribute as above. Instead the browser load every single class file from the webserver. This has some problem too. Coz the browser sometimes just thorough NullPointerException or ClassNotFoundException. After much of debugging I found out that the problem is the IE browser which seldom fails to load classes or image file from the server. If i referesh the browser the applet and all its classes loaded successfully and runs smoothly. This behaviour never occurs when running with "appletviewer".
    I wanted all my classes to be loaded from my jar file. After much of trial and error I found out that if i remove "codebase" attribute the browser loads the classes from my jar file and applet loads very fast. This is where the second problem comes in. The browser does not reload my webcam image file so that the webcam become alive with live images, like before.
    If I run on "appletviewer" everything works fine my web cam is displayed properly. But in IE browser the image does not get reloaded when I refresh my image to give live to my webcam display. The refresh method is given below.
    private void refresh(final URL url) {
    Image webCamImage =getImage(url);
    webCamImage.flush(); // flush out the previous image
    webCamImage = getImage(url); // get a new image
    webCamImageIcon.setImage(webCamImage); webCamImageIcon.paintIcon(webCamLabel, webCamLabel.getGraphics(), 15, 15);
    When I add the "codebase" attribute back, the image gets reloaded for every refresh() and everything works fine. But the classes are also loaded from the server. And occasionally also suffers Class loading and image loading problem. As I presented earlier, when I do refreshing in the browser everything gets loaded and the applet function correctly with web cam displaying very well.
    The problem is so strange that I could not find any way to solve it.
    It would be a great help to me if somebody provide me some work around to the problem.
    I tested on Windows 2000, Windows XP, IE 5.5, IE 6 with J2SDK 1.4.0.
    Thank you all very much in advance.
    best regards,
    Judge

    Thank you so much for the suggestions. I did tried the way u suggested. The problem still the same.
    I think its the problem between IE browser and Java Plug-in.
    I which SUN would find these incompatibilities and solve these problems.
    I even tried using java SDK and plug-in 1.4.1 it even worst. It can't even load an applet. And it does not show any loading messages nor any error messages. It just show a cross sign on the upper left coner.
    I would be so glad, if Sun would try to eliminate the inconsistancies such as caching, loading, initializing etc between browser and its Java plug-In. For example, applets behave well in appletviewer and behave unpredictably in browser environment.
    I have seen so many people in the forums with all sorts of problems because of this.
    Right now I m desperately looking for work around to my problem.
    If somebody would provide me with the solution to my problem it would be a great help to me.
    thank you all so much.
    best regards,
    Judge

  • Buttons become the same size as my image?? PLEASE HELP

    Hi guys,
    this is the second posting of this topic, as in the first one i didn't post my code properly (sorry!!!)
    My problem is that the buttons i have in the code come up as the same size as the 'Goldsmiths' Image. How can i alter the provided code to make the image stay the same size and the buttons to have the default button size?
    Thanks
    //SSPanesar
    //copyright 2005 all rights reserved
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.URL;
    public class SwingApplication implements ActionListener {
    private static String labelPrefix = "Number of button clicks: ";
    private int numClicks = 0;
    final JLabel label = new JLabel(labelPrefix + "0 ");
    //Specify the look and feel to use. Valid values:
    //null (use the default), "Metal", "System", "Motif", "GTK+"
    final static String LOOKANDFEEL = "System";
    public Component createComponents() {
    JButton button = new JButton("I'm a Swing button!");
    button.setMnemonic(KeyEvent.VK_I);
    button.addActionListener(this);
    label.setLabelFor(button);
    JButton button1 = new JButton("I'm a Swing button!");
         button1.setMnemonic(KeyEvent.VK_I);
         button1.addActionListener(this);
    label.setLabelFor(button1);
    JButton button2 = new JButton("I'm a Swing button!");
         button2.setMnemonic(KeyEvent.VK_I);
         button2.addActionListener(this);
    label.setLabelFor(button2);
    JButton button3 = new JButton("I'm a Swing button!");
         button3.setMnemonic(KeyEvent.VK_I);
         button3.addActionListener(this);
    label.setLabelFor(button3);
    JButton button4 = new JButton("I'm a Swing button!");
         button4.setMnemonic(KeyEvent.VK_I);
         button4.addActionListener(this);
    label.setLabelFor(button4);
    JLabel label = new JLabel();
         URL loc = getClass().getResource("smalllogo2.gif");
         Icon icon = new ImageIcon(loc);
         label.setSize(icon.getIconWidth(), icon.getIconHeight());
    label.setIcon(icon);
    JLabel label2 = new JLabel();
         URL loc2 = getClass().getResource("SheeraAutoRepair2.jpg");
         Icon icon2 = new ImageIcon(loc2);
         label2.setSize(icon.getIconWidth(), icon.getIconHeight());
    label2.setIcon(icon2);
    * An easy way to put space between a top-level container
    * and its contents is to put the contents in a JPanel
    * that has an "empty" border.
    JPanel pane = new JPanel(new GridLayout(0, 1));
    //pane.setLayout(new FlowLayout(FlowLayout.RIGHT));
    pane.add(label);
    pane.add(button);
    pane.add(button1);
    pane.add(button2);
    pane.add(button3);
    pane.add(button4);
    pane.setBorder(BorderFactory.createEmptyBorder(
    30, //top
    30, //left
    10, //bottom
    30) //right
    pane.setBackground(Color.white);
    return pane;
    public void actionPerformed(ActionEvent e) {
    numClicks++;
    label.setText(labelPrefix + numClicks);
    private static void initLookAndFeel() {
    String lookAndFeel = null;
    if (LOOKANDFEEL != null) {
    if (LOOKANDFEEL.equals("Metal")) {
    lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
    } else if (LOOKANDFEEL.equals("System")) {
    lookAndFeel = UIManager.getSystemLookAndFeelClassName();
    } else if (LOOKANDFEEL.equals("Motif")) {
    lookAndFeel = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
    } else if (LOOKANDFEEL.equals("GTK+")) { //new in 1.4.2
    lookAndFeel = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
    } else {
    System.err.println("Unexpected value of LOOKANDFEEL specified: "
    + LOOKANDFEEL);
    lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
    try {
    UIManager.setLookAndFeel(lookAndFeel);
    } catch (ClassNotFoundException e) {
    System.err.println("Couldn't find class for specified look and feel:"
    + lookAndFeel);
    System.err.println("Did you include the L&F library in the class path?");
    System.err.println("Using the default look and feel.");
    } catch (UnsupportedLookAndFeelException e) {
    System.err.println("Can't use the specified look and feel ("
    + lookAndFeel
    + ") on this platform.");
    System.err.println("Using the default look and feel.");
    } catch (Exception e) {
    System.err.println("Couldn't get specified look and feel ("
    + lookAndFeel
    + "), for some reason.");
    System.err.println("Using the default look and feel.");
    e.printStackTrace();
    * Create the GUI and show it. For thread safety,
    * this method should be invoked from the
    * event-dispatching thread.
    private static void createAndShowGUI() {
    //Set the look and feel.
    initLookAndFeel();
    //Make sure we have nice window decorations.
    // JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame = new JFrame("SwingApplication");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //final int width=300;
    //final int height=400;
    frame.setSize(600,900);
    SwingApplication app = new SwingApplication();
    Component contents = app.createComponents();
    frame.getContentPane().add(contents, BorderLayout.CENTER);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    }

    You still aren't using the "code" formatting tags as was suggested in your first posting in the forum.
    when i add the picture and the buttons go vertically down from the image,Well, this doesn't make sense since you are using a FlowLayout which means components will be displayed horizontally on a line, not vertically.
    If you need further help then you need to create a [url http://www.physci.org/codes/sscce.jsp]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided. (ie. the code doesn't compile so we can't test it).

  • Loading images from Jar - Please help!

    Tried with / in front of the path or without and using both
    getImageResource and getSystemImageResource methods and no images
    are showing.
    My jar has manifest file of:
    Main-Class: com.package.MainFrame
    Class-Path: j2ee.jar
    - blank line -
    Thanks
    Abraham Khalil
       // The subtlety in getResource() is that it uses the
       // Class loader of the class used to get the rousource.
       // This means that if you want to load a resource from
       // your JAR file, then you better use a class in the
       // JAR file.
       public static Image getImageResource( String name ) throws java.io.IOException {
          return getImageResource( AWTUtilities.class, name );
       public static Image getImageResource(Class base, String name ) throws java.io.IOException {
          Image result = null;
          URL imageURL = base.getResource( name );
          if (imageURL == null) {
             imageURL = base.getResource("/" + name );
          System.out.println("imageURL: " + imageURL + " AWTUtilities.class.getResource(" + name + ");");     
          if ( imageURL != null ) {
             Toolkit tk = Toolkit.getDefaultToolkit();
             result = tk.createImage( (ImageProducer) imageURL.getContent() );
          return result;
       public static Image getSystemImageResource( String name ) throws java.io.IOException {
          Image result = null;
          URL imageURL = ClassLoader.getSystemResource( name );
          if (imageURL == null) {
             imageURL = ClassLoader.getSystemResource("/" + name );
          System.out.println("imageURL: " + imageURL + " = ClassLoader.getSystemResource(" + name + ");");
          if ( imageURL != null ) {
             Toolkit tk = Toolkit.getDefaultToolkit();
             result = tk.createImage( (ImageProducer) imageURL.getContent() );
          return result;

    Hello,
    you must put your images files under your package :
    see full doc at this tutorial.
    Hope this helps,
    Neo

Maybe you are looking for