Set image in the title bar been shown distorted

I have an 16x/16x gif image that I am placing before title in a JFrame using setIconImage();
The code I am using is
this.setIconImage(
Toolkit.getDefaultToolkit().createImage(
                              ClassLoader.getSystemResource("GIF.gif")));However the image comes up very ugly.
Please I need your help with this one.

I dont see nothing wrong with your code it has to be the image you are useing try another image and see if it works
import java.awt.*;
import javax.swing.*;
public class c extends JFrame  {
public c() {
      setSize(300,300);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      setVisible(true);
      this.setIconImage(Toolkit.getDefaultToolkit().createImage(                              ClassLoader.getSystemResource("gem3.gif")));
    public static void main(String[] args)  {
       c h = new c();//constructor

Similar Messages

  • Is it possible to add a button with image on the title bar(IDR)?

    I look through all the buttons in the example, All of them does not with an image on them.
    Is it posslbe to put a image on the title bar?
    Best regards?
    Blake Le

    hi, Julia,
    Sorry for the misleading. I want to add a button below the IDR area. And for common button it's OK.
    Now the situation changed , i need to add an icon to a button , to make the user interface more beautiful.
    Is that possible?
    Best regards,
    Thanks very much for your help.
    Blake Le

  • How to insert image in the title bar?

    Hi experts,
    how to insert the image or icon in the title bar of a screen, similar to the screen below.
    Att.,
    Luiz.

    Hi Luiz,
    You can create them in GUI Status. If you are using a module pool program uncomment SET PF-STATUS '<STATUS-NAME>' statement, double click on  <STATUS-NAME> and you will be directed to the screen for setting your GUI status.There you can create buttons with desired icons. If it is a report program add SET PF-STATUS '<STATUS-NAME>'  statement to your program and follow the same procedure.
    Refer the wiki for more details.
    GUI Status of A Program using Menu Painter - ABAP Development - SCN Wiki
    Regards
    Anoop

  • To change the image by the title bar.

    Hi,
    I have been trying to change the existing image in the title of the report.
    I tried reducing the image size through paint. And once i add this image in the title, it is showing the cross mark with letters 'LOGO'.
    Thanks,
    Sindhu

    Have you restarted the services after updating your image?
    You might have to use below syntax for calling the image
    fmap:location/image_name
    location->something like
    s_oracle/Images
    Ex: fmap:Images/newlogo.gif
    If this is not helping can you share your screenshot of the Title thru email or any other form.
    If helps mark
    Edited by: Srini VEERAVALLI on Feb 12, 2013 9:36 PM

  • Displaying image in the Title bar

    hi ,
    can any one help me to display image in the JFrame Title Bar Left Corner, Right Corner, orMiddle ..

    double post http://forum.java.sun.com/thread.jsp?forum=57&thread=554453

  • Setting buttons in the title bar of JPanel

    Hi,
    Help me out! How do I set Minimize, Maximize and Exit buttons in a JPanel? Is there a option.
    Thanks,
    Kelly.

    0. you need 3 image file, one for each button
    1. set the panel P layout to borderlayout.
    2. create a new panel N and add it to the north of P.
    3. set the background of N to GradientPaint and use nice colors.
    4. add the buttons to N panel using FlowLayout RIGHT.
    5. add a nice border to P
    if you will add an image to left side of N you will have a JPanel that looks like a frame.
    Noah

  • Setting an icon in the title bar of a JFrame...

    Hi,
    how do I set an image (icon) in the title bar of a JFrame (in the top left corner)?
    In JInternalFrame there is a method
    public void setFrameIcon(Icon icon)to set an image in the title bar of this internal frame - but in a JFrame I didn't find any method like this...
    Thanks in advance
    - Stephan

    Thanks ICE, that works for me...
    this.setIconImage(new ImageIcon("img\\foo.jpg").getImage());- Stephan

  • "Backup file" appears in the title bar.

    Hi there,
    I've been writing a VI which has recently crashed but I could recover it using the backup file. However "Backup file" now appears in the title bar as shown in the picture I attached with this post and I would like to get rid of the "Backup file" in the title bar . I've tried the "save as" option using a different name but "Backup file" is always present. 
    Could someone help me on that one?
    Thanks a lot
    Badis
    Solved!
    Go to Solution.

    Badis,
    please check if the displayed VI name is set to Backup File (VI settings >> Window Appearance).
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Odd action using the icon in the title bar of image in psCS5--???????

    i use imac, lion.
    by accident, i discovered that, clicking on and dragging the icon at the left of the title bar (actually within the title bar to left of file name),  i can sometimes open the
    image in ACR,  as hosted by BRIDGE (which is not running. i do not use bridge).
    sometimes the image will be duplicated following this dragging of icon, the new duplicate lying atop the image of the background layer, in the same window, and shows the diagonal bars awaiting resizing. if i just click the ("checkmark")  in the options bar to accept this new layer,  or, if i  press enter, i am looking at a new layer, which is a duplicate of the background layer. this new layer is a "SMART OBJECT", and functions as such.
    this happens only with JPG and TIF files, not with RAW.  i have ACR prefs set to open all supported jpg and tif files.
    i should note that none of this occurs if the image has been edited in any way. in fact, after any edit the icon in the title bar is not movable.
    i am having some difficulty describing a simple and quick process. i don't know if this is a bug, a feature, or the result of too much RED BULL!  i Just reread post and it does seem delusional.
    can anyone help?

    it seems to work with or without the shift key.
    I work with OS 10.6.8 and you are right that it works without shift, too.
    My surmise is that the title bar’s icon of non-dirty files (files that have no History steps save the Open-step or have just been saved) behaves like the file’s icon in the Finder as the behaviour seems to be exactly like a drag-and-drop from the Finder (as a Smart Object if set in the Photoshop > Preferences > General > Place or Drag Raster Images as Smart Objects, not if set otherwise) and works across files, too.
    I don’t think I had noticed that previously, but that behaviour may well be fully intentional.

  • Set an icon in the title bar.

    Hello,
    i am unable to set an icon before the title in the title bar.
    i am using jdk1.4.
    could someone plz tell me how to do this.
    i have tried the setFrameIcon method...but it only works for internal frames...not for JFrame.
    By default it is the tea cup and saucer icon( well, that is what it is right?)...how can i replace this with my own icon?

    Try this,
    Toolkit kit = Toolkit.getDefaultToolkit();
    Image icon = kit.getImage("myicon.gif");
    setIconImage(icon);

  • Why do the title bar on Firefox and taskbar on Windows 7 leave distorted image when a list of bookmark folders crosses either one ?

    I use lots of folders in my bookmarks list. I have noticed that with both AMD and Nvidia based video cards, that if I am using a folder in my bookmarks list that has lots and lots of bookmarks, the list of bookmarks will cross both the title bar area of Firefox and the taskbar on Windows 7 at the bottom. When this happens, both the title bar on Firefox versions 8-10 and the taskbar at the bottom will leave images from the bookmark list that don't go away (unless I use F11 view fullscreen to clear away the image and restore to normal ). If I am using a Matrox video card, this doesn't happen. Why is this?

    Hey cor-el,
    Wow. That did it. You are a genius! Thank you, thank you. It's very important that I be able to use the folders with saved bookmarks feature for my business which I rely on daily.
    I unchecked the "use hardware acceleration feature" where you said it was in Firefox 9 browser and it resolved the problem immediately. I am using an Nvidia GS8400 video card. I was having the same problem on the new ATI/AMD video cards too (haven't tested though on ATI computer yet). My Matrox M9120 doesn't do that at all though. Do you have any idea why that is ? Is it a software conflict between Nvidia or AMD drivers and Firefox?
    One more question on your response solution, why do you recommend upgrading to current video card drivers since un-checking the "hardware acceleration" feature in Firefox works? The video card drivers on the disc that came with the card I am using were supplied by the manufacturer and released last year. Shouldn't that be good enough?

  • How to replace the icon in the title bar and minimized window

    I am not sure if this is a Swing question. But since nobody answered it in the Java Programming forum, let me place it here:
    I would like to set my own icon in the title bar and in the minimized window of my java application, replacing the java coffee cup icon.
    I am using:
    frame.setIconImage(new ImageIcon("image.gif").getImage())
    as was suggested previously in the Java Programming forum at:
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=5212059
    This does create the icon in both places. However, it only works when I run the program from JBuilder 2006. It doesn't work if I run the program from the .jar or the .exe file.
    How can I make it work for my .jar and .exe file?
    Please help! Thanks!

    It doesn't work if I run the program from the .jar...working example for a .jar
    import javax.swing.*;
    import java.awt.*;
    class Testing
      public void buildGUI()
        JFrame f = new JFrame();
        Image img;
        try
          java.net.URL url = new java.net.URL(getClass().getResource("Save.gif"), "Save.gif");//correct capitalization required
          if (url != null)
            img = javax.imageio.ImageIO.read(url);
            f.setIconImage(img);
        catch(Exception e){}//do nothing - default will display
        f.setSize(200,200);
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • How can I get back the title bar in Thunderbird 38?

    The title bar can be turned on and off in Firefox. In the current version of Thunderbird (31), the title bar is present by default and there is no option to turn it off. In the beta version (38), there is no title bar by default… but I can't believe that there's no way to get it back. So, where is this setting? I can't find it.

    I sure agree that the setting isn't easily discoverable, but that's too late for the 38.0 release given that string freezes went in effect already (the reason being that localizers have to translate all UI elements for their respective language).
    The respective [https://bugzilla.mozilla.org/show_bug.cgi?id=814571 bug report] has been up for more than two years, but thus far not much progress in terms of a solution acceptable by the developers. I don't know if the extension proposed in the last comment was ever developed and posted.

  • How do I chng the title bar text to lighter instead of blk over navy?

    I have the wolf image with navy title bar. Can't see the black text in the navy title bar. How do I change these colors? Already been to Tools/colors.

    I found a configuration on Web template parameters.
    WAD -> TEMPLATE -> Web Template parameters -> Behavior -> Template has ON ->
    Main Object Data Provider -> Data Provider DP_1) (or whatever you entitle your DP).
    Now the report shows the query tech name in the browser title.

  • How to set an icon in title bar and minimized window

    I would like to set my own icon in the title bar and in the minimized window of my java application, replacing the java coffee cup icon.
    I am using:
    frame.setIconImage(new ImageIcon("image.gif").getImage())
    as was suggested previously in this forum at:
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=5212059
    This does create the icon in both places. However, it only works when I run the program from JBuilder 2006. It doesn't work if I run the program from the .jar or the .exe file.
    How can I make it work for my .jar and .exe file?
    Please help! Thanks!

    BrigitAnanya wrote:
    This is urgent! What? Replacing an icon is urgent? That's ridiculous.
    Can anyone tell me how I can replace Sun's Java Icon?The way you were already told. Only if you aren't going to put the icon in your current working directory, don't write code that assumes the icon is in your current working directory.

Maybe you are looking for

  • Logic crashes when select 'help'

    Hi I am very new to apple / iMac / logic. Managed to get it installed etc but it crashes every time I press help from the top menu. Does anyone have this problem?

  • HT1349 how to deauthorized my computer my account say i have 5 authorized

    i am trying to download music i purchased from the itune store and it get a message saying i have 5 computer authorized.i had the account for years and i had 2 computer crash hard drive went bad so i did not how to deauthorized them with the hard dri

  • Accept license scripting error spread to Solaris pages?

    Unable to download Oracle Client for Solaris 64 bit software WEBPAGE BROKEN - Oracle CLIENT - Solaris

  • Cannot play music from iTunes on my computer

    Hi, I looked through all your infos and posts, and none of the recommendations solved my problem. When I click a song, the little phono symbol is activated, but it does not play the song. The same is true if I click a song and then hit the play butto

  • NIS master Configuration

    How to configure a NIS Master server, Lets I tell myself what i knows, hostname:host Domainname : domain #cat /etc/hosts 127.0.0.1 localhost 192.168.0.1 host domain #cat /etc/defaultdomain domain copy all the files from /etc folder to /var/yp directo