Change Coffee cup icon on JDialog & JOptionPane

I try to change the coffee cup icon on my JDialog and JOptionPane.
My JDialog box does not load the Parent Icon (JFrame icon), and not even show a coffee cup icon.
My JOptionPane would just show a coffee cup icon, eventhough its parent is the above JDialog with no icon.
Is there anyone know how to fix this?
I'd like show my icon on the JOptionPane instead of the coffee cup icon.
And also to show my icon on the JDialog instead of nothing, not even a coffee icon.
Any help is appreciated.
CL

Passing a parent with the desired icon to the JDialog/JOptionPane should solve your problem, however there is a bug in swing that prevents any icon from showing in the titlebar if a JDialog is made non-resizable (through a call to setResizable(false)).
The bug adatabse says that this has been resolved but I am using jdk 1.3.1 and continue to have this problem.

Similar Messages

  • How can I remove or replace the " Java coffee cup " icon ???

    I'd like to ask everybody some questions about the " Java coffee cup " icon
    doesn't JToolbar be able to pull out of Frame?
    but the JToolbar which was pulled out would have a little Java coffee cup icon
    just like JOptionPane,JDailog or JFrame.
    Is there any solution to remove this icon??
    equally....
    How can I remove or replace the little Java coffee cup icon of the title in
    JDialog or JOptionPane??
    Taking JFrame for instance, if I use "this.setIconImage(xxxxxxx);" then I can
    change the little Java coffee cup icon.
    but it seemed invalid to use it in JDialog.
    How can I solve it in JToorbar,JDailog and JOptionPane ???
    my e-mail : [email protected]

    this seems to be to most asked question at least in this forum.... only topped by the question about 'how to make an exe out of java apps' in the Java Programming Forum.
    Sorry, but is there anybody who has noticed those useful textboxes where it says 'Search'? I mean before there were computers one had to go to a library, ask somebody or perform extensive research until answers were found. Or one had to buy books only to find out the the other book he though about buying would have been better.
    Nowadays, simply type somthing like 'coffe cup' into a place where it is possible to do so and click into a region where it says 'Search' somewhere. Not even necessary to go to a froum like this and swamp it with the one trillionth version of this question, almost any search box might bring an answer (let it be right or not..).
    Although I have to admit that this instance is the most prosaic and least understandable one I have seen for long...
    Again sorry but I had to say that.

  • How do I remove the coffee-cup icon in Windows's frames?

    Hi Java developers!!!
    I'd like to know if there's a way I can remove that small icon at the upper-left corner of an AWT Frame that
    appears on every window under Windows. As far as I know, there are licensing restrictions that won't let me
    distribute any program that use these copyright-protected icons/images in any program unless Sun
    explicitly tells me so. Ideas anyone?
    - Heriberto Delgado
    Sui Generis S.A.
    ([email protected])

    (Sorry for my bad english, I'm from Costa Rica.)
    Ok, let me explain it. Frame.setIconImage() gets rid of the coffee-cup icon in the frame, so that the old icon is
    not visible again in the application, thus it's not infringing any Sun-imposed copyrights on it's usage. That works
    when the application is run under Windows, and possibly other OSes. However, Windows is my only current
    development platform, and I don't know how my application will really look on other OSes, as
    Linux/Solaris/MacOS/etc., and I'm actually worried about if other Sun-proprietary icons/images will appear in my
    application when opened within these OSes, besides the coffee-cup icon. Should I be worried, or not?
    Again, thanks for your quick response!
    - Heriberto Delgado
    Sui Generis S.A.
    ([email protected])

  • Changing the Title Icon of JDialog

    Hello All,
    Is there any way to change the coffer cup icon which appears in the top of a JDialog?
    In JFrame,we can use setIconImage().But that doesn't work here.
    Could anyone give me a solution for my problem.?
    Thanks in Advance,
    Regards,
    Vijayakannan

    http://forum.java.sun.com/thread.jsp?forum=31&thread=406035

  • Changing the coffee cup Icon in Titlebar?

    HI
    I read all thrads about this but still dont get it working. I tried it 3 ways:
    1:
    ImageIcon pic = new ImageIcon("pic.gif");
    this.setIconImage(pic.getimage());
    I call this function in the constructor of the frame Object. Pic is in same folder as the class. Frame appears but NO icon is shown (just blue Titlebar)
    2:
    this.setIconImage( new ImageIcon( Classloader.getSystemResource("pic.gif")).getImage());
    brings up a NULL pointer Error :(
    3:
    this.setIconImage(Toolkit.getDefaultToolkit().getImage(packetName + "pic.gif"));
    where packetName is the full packet path.
    this on e also gets me an NULL pointer Error.
    I dont know what to do anymore. Please help! THanks!

    2. this.setIconImage( new ImageIcon( Classloader.getSystemResource("pic.gif")).getImage());
    This is the best thing to do if you don't know where your classes will be installed. Put your image in your classpath and you're done. If it didn't work for you then it may be because your class is in a package. Here's what I do:
    setIconImage(new ImageIcon(this.getClass().getResource("/pic.gif").getImage());
    Note the slash at the beginning of the file name. If my class is named com.hoser.SuperGUI, then it will be in a directory named .../something/com/hoser. I put the pic.gif file in the .../something directory, which would be one of the directories in my classpath, and the getResource() method finds it there.
    If I left off the slash, then getResource() would be looking in my classpath for com/hoser/pic.gif, and in that case I would have to put the file into the .../something/com/hoser directory.

  • How can we change the 'coffee cup' symbol

    sir/madam
    could you please tell me ,how can I change the coffee cup icon
    appeard at the left corner of the window to my own icon or image.

    public void JFrame.setIconImage(Image image)

  • Replace grouped window task icon from java coffee cup with customised icon

    I have an application that a child JFrame instance can be triggered from the main JFrame instance. In that case, these JFrames are collapsed under one group icon on my task bar in windows, which is the java coffee cup icon with tooltip of Java(TM) Platform. When i expand the list, each individual JFrame still has the right personised icon. Can anyone suggest how do I customised the group icon to be my own icon and have personised tooltip? Thanks in advance.
    Edited by: muagi on Sep 22, 2009 3:20 AM

    mbisping, stop spamming links for a commercial product to old threads, or your account will be blocked without further warning,
    I'm blocking your post.
    db

  • Why do I see a coffee cup image?

    Hi everyone,
    I am trying to watch videos for grad school through the blackboard website and when I click on the image to view, a coffee mug with arrows circling around it appears. Last semester I didn't have any problems watching the videos.
    I have downloaded the newest version of Adobe Flash Player as well as Flip 4 Mac. Nothing has helped thus far.
    Any advice would be greatly appreciated.
    Thanks,
    Jennifer

    The "coffee cup" icon means the file is served using Java.
    QuickTime is not involved.

  • Change the coffe cup icon

    Do someone know how to chage the coffe cup icon"on the topleft" on the Jframe window?????

    yerJFrame.setIconImage (yerImage);Kind regards,
    Levi

  • Add animated gif to JFrame toolbar in place of default coffee cup

    Hi,
    I am sorry if someone has already asked this question. I have searched the forums but only found aswers relating to adding static images to replace the default coffee cup. Is it possible to replace this image with an animated gif? When I add an animated gif with the following code:
    URL imageUrl = myProgram.class.getResource("image.gif");
    ImageIcon icon = new ImageIcon(imageUrl);
    JFrame frame = new myProgramFrame();
    frame.setIconImage(icon.getImage());
    I am loading the image from an executable jar.
    The program fails to load (but produces no errors).
    Thank you for any help you can offer.

    Hmmm ... intrestin, I've just modified a *.gif file of my own to make the icon animated and 'java MyProgram' just hangs at the command line -so, I guess you're stuffed with it. I can't think of a workaround either, sorry

  • Customize the default COFFEE MUG icon provided by java

    How can i change the default coffee mug icon provided in the Frames using the JFrame classes.I do need a customized icon for my application.Though there exista an setIcon method , but its usuable only to the JInternalFrame classes.
    Help required ???

    User setIconImage(). Note it takes and Image where as the setFrameIcon() method of JInternalFrame takes and Icon.

  • Image icon in JDialog

    i have a login UI , when i clich on change password it opens
    a JDialog , i am passing 2 parameters with the call, the username and the
    login frame object , In the constructor of Jdialog class i am again taking
    2
    parameters , the username and the frame object , and calling super with
    frame object, but the IconImage of the parent frame is not displayed in
    JDialog ... can anybody explain..

    I don't think I understand the problem. Can you be a little more specific?
    You have a frame with an icon. And then when you clic on a button of this frame, you show a dialog. Is that true?
    If it is, then it has to work. I've done several times without any trouble.
    class YourFrame extends JFrame
       JButton yourButton = new JButton();
      //more code
      //inside the method that it's call with yourButton is clicked
      YourDialog yourDialog = new YourDialog(this);
    class YourDialog extends JDialog
      //code
      public YourDialog(Frame parent)
       super(parent, "Tittle", true); //for example
    }This structure have to work.

  • Replacing Java cup icon - ATL tab

    Hi,
    I want to replace the Java cup icon with one of my icons.
    I can do that OK using the JFrame.setIconImage() method. (By the way, I think it should have been possible to do so using the Look and Feel only rather than explicitely setting the icon on each frame...)
    My problem is that on Windows, when switching from one application to another using the ALT - Tab keys, the icon that is displayed is my icon uglyly enlarged...
    Is there a way to setup TWO images to be used :
    - one (16*16) for the small icon on top of the window and
    - another one (32*32) that would be used for the application switching screen ???
    How come the coffee cup is actually nice looking when displayed on the application switching screen ?

    Unfortunatly you can't do that.
    Try to use a 32*32 icon only. It will be streched automatically to 16*16 in the frame title bar.
    Denis

  • I hate that coffee cup!!!!

    Could someone please teach me how to get rid of that coffee cup in the left of the title bar in a JFrame and replace it with my own icon??
    Since I have no Duke dollars left, I'm offering 10 real dollars(US) to the person who can answer this for me. I'll just send a quick PayPal Payment. Please help.
    Regards,
    neowhere

    Thanks. I guess the first person to answer the
    question correctly was chuanhaochiu. I owe you $10.
    Do you have a email address that I can send a PayPal
    payment to?
    Extending a kind Thank you,
    neowhere10 bucks for this crap? You gotta be kidding... this is the kinda information you can find around here quite readily for free.
    Anyhow, since you're paying someone for a "right" answer, I felt I would warn you about what you're paying for.. Toolkit.getImage doesn't always return the complete image. It loads it asynchronously.. You'd have to use a mediatracker alongside it to make sure the image is loaded completely EVERY time.
    An easier way, which uses a mediatracker internally to assure the image gets set EVERY time is this:
    frame.setIconImage(new javax.swing.ImageIcon("path").getImage())

  • Downloading iTunes changes all my icons to iTunes

    When I download iTunes onto my computer (Windows 7) it changes all the icons on my desktop to iTunes and iTunes will not open at all. Help please!

    Hiya Katrina! I might have accidentally made some progress on this one yesterday.
    Every time I've seen it reported and I've tried to do some work on it, it has only affected one user account on the PC.
    So ... it might be related to a damaged icon cache for the affected user account. (There's one of those for each different user account on the PC. This is what I accidentally learned yesterday while trying to research a fix for a slightly different problem.)
    If that's what is going on, rebuilding the icon cache might get folks past it:
    http://www.winhelponline.com/blog/how-to-rebuild-the-icon-cache-in-windows-vista /
    ... Trouble is that that's all educated(?) guesswork/speculation, and the procedure looks a bit hairy. It's the sort of thing where I'd definitely be setting a System Restore Point for the system prior to giving it a go.

Maybe you are looking for