Changing the logo in the Title Bar of a JFrame

How do I change the logo in the left hand corner of the Title Bar of a JFrame window.

Hi Sverigeterje
Thanks.
That's very neat. All done with one line of code, as opposed to the two lines of code I found in an answer (dated Jan 8, 2001) from Alexander Smirnov in response to a similar question (dated Sep 16, 2000) from Shawn Barker. (http://forums.java.sun.com/thread.jsp?forum=31&thread=49970 - Jan 8, 2001)
ImageIcon image = new ImageIcon("CustomIcon.gif");
this.setIconImage(image.getImage());
Once again many thanks.
George (aka cyberking1)

Similar Messages

  • Working with a projector file. How can center it, not allow scaling and change the title bar?

    I've tried using:
    import flash.system.fscommand;
    fscommand("allowscale", "false");
    fscommand("showmenu", "false");
    fscommand("fullscreen", "false");
    on frame 1, but they don't seem to work.  I'm going to be putting this project on a CD and the client wants to make sure it will open centered on the user's screen, which has not been the case so far.  It seems to open at different spots on different computers.
    They also want the title bar changed from "Adobe Flash Player 10" to their own title.
    Thanks in advance for the help.

    hkunz219 wrote:
    You can use: stage.scaleMode = StageScaleMode.NO_SCALE; As for the title bar change, you can change the title bar string using Resource Hacker. But i am not sure if that is legal. You will find the strings under the strings table.
    What did you mean by, "You will find the strings under the strings table."?  Were you talking about Resource Hacker?

  • Embedding HTML in the Title Bar of a JFrame

    Hi Folks,
    I have a simple question. Do you know I can I employ an HTML-enabled script in the title bar of a JFrame? I would like to make use of the subscript tag in HTML <sub>, yet it didn't work out:
    public class MyFrame extends JFrame{
    super("<html>KPC<sub>V.10</sub></html>");
    }I don't know what I am doing wrong, but the title appears with the HTML tags, not in the way I would like it to be formatted. What would you suggest?
    Regards,

    The frame title is (typically) set in a native OS frame, which is not controlled by Java.
    Perhaps if you tell Java to let the L&F control the frame decorations it might work, but probably not, as it would probably just try to mimic what the OS does anyway, which is to not support HTML.
    So basically, you can't.

  • 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

  • How to change the title bar wdith , scroll bar widths in tune with a 7" screen

    can you please help me customize my user chrome section so that I can REDUCE the WIDTH of the scroll bar ( horizontal and vertical ) . That is , at max the scroll bar can be ___ pixels of __ % of total width. ( prefer the relative reference )
    Also the title bar ( that black surrounding area that bears the minimize, maximize,close buttons ) needs its width reduced to half of what it is now. How do I do this ?

    No. That doesn't work any more. In current Firefox versions native scroll bars are used and you can't do style those via userChrome.css (user interface; chrome windows) and userContent.css (websites). You can try a large theme if you do not want to make the changes via the Control Panel

  • How to catch drag event in the title bar of a jframe

    Hi
    I want to catch the drag event in the title bar for jframe, because I have a few more window, dialogs, which I want to move along with my main window
    Thanks

    you can use a listener like tih one below...it works if you don't move to quickly.....
    class SynchroMover extends ComponentAdapter{
      private JFrame master;
      private JFrame[]slaves;
      private int currentX;
      private int currentY;
      public SynchroMover(JFrame master,JFrame[]slaves){
        this.master = master;
        this.slaves = slaves;
        currentX =(int) master.getLocation().getX();
        currentY =(int) master.getLocation().getY();
      public void componentMoved(ComponentEvent e){
        int dx = (int)master.getLocation().getX() - currentX;
        int dy = (int)master.getLocation().getY() - currentY;
        System.out.println(dx+" "+dy);
        for(int i=0;i<slaves.length;i++)
          slaves.setLocation((int)(slaves[i].getLocation().getX()+dx),(int)(slaves[i].getLocation().getY()+dy));
    currentX = (int)master.getLocation().getX();
    currentY = (int)master.getLocation().getY();
    the code isn't optimized...so you can probably do better

  • ITunes 9: "M:\" in the Title Bar

    Before upgrading to iTunes 9, the title bar on the main iTunes simply said, "iTunes". However, after upgrading to iTunes 9, the title bar text has something different: "M:\"
    I keep my iTunes library (and the associated database files) on a partition of an external hard drive, to which I assigned the drive letter M. (M = "music," get it?) Anyway, I just find it strange that the main iTunes window says "M:\". It would be totally confusing if you also had an Explorer window open to the M drive (the title bar of which would also show "M:\"). Is there any way to change the title bar back to showing "iTunes" before this "M:\" problem drives me crazy?

    This looks like an intended new feature of iTunes 9.
    The title shows the name of the folder containing your iTunes library. Presumably it is intedned to help people who use iTunes with different libraries to see which library they are currently using.
    If you don't like the feature, you need to use the feedback option on the iTunes help menu.
    I would guess that you can fix this if you don't like it by closing iTunes and then renaming the folder containing your library to iTunes. Then do a shift key start to tell iTunes the new location of the library.
    Hold down the shift key and start iTunes,. keep holding the shift key until your are promoted to choose a library. Navigate to you newly named iTunes folder and choose iTunes library.itl.

  • Getting rid or hide of the title bar without using jwidow

    hi everyone,
    is there any way to get rid or hide of the title bar in a Jframe without using JWindow because this one didn't conserve all the abilities a JFrame(listeners)...
    thanks in advance

    It is setUndecorated(true), but you'll need version 1.4 to use it. If you don't have it, then you use JWindow...
    http://java.sun.com/j2se/1.4/docs/api/javax/swing/JFrame.html

  • Changing color on the title bar

    How can I during runtime change the color of the title bar? I want to flash the title bar to warn, but I haven't found the function to set the color of it yet...
    Thanks in advance!
    Regards,
    Andreas

    since 1.4 you can use
    JFrame.setDefaultLookAndFeelDecorated( true );
    JDialog.setDefaultLookAndFeelDecorated( true );to get jframes and jdialogs looking like jinternalframes. but i don't know if it is now possible to change the color.
    tobias

  • Changing the owner/user name in the title bar

    I was just given my ipod nano by my niece. However, her name still scrolls across the title bar on the screen. I would like to change it to my name. I can not find ANY information on how to do that anywhere. Can someone give my (detailed) instructions on how to change it? Thanks!

    Select the iPod in the iTunes source list, click on its name, and type a new name.
    (53927)

  • Change the color of text in the title bar

    Hi,
    I have a JFrame. I want to be able to change the color of the text in the title bar. Do any of you know how to do this ?
    Please let me know.
    Thanks
    Sangeetha

    If you are using Windows, you do it through the Control Panel tool for customizing your desktop display. If you are using some other system, I don't know. You can't do it from your Java program.

  • Changing the icon in the title bar

    How can I go about changing the Icon in the title bar that goes next to the title?

    setIconImage(Image image) for JFrame.
    setFrameIcon(Icon icon) for JInternalFrame.
    Take a look at the API.

  • How can I change the width and color of the title bar of the JFrame

    I would like to use the UImanager to change the look and feel of the title bar on all of my JFrames. How is this possible.
    Thanks in advance.

    I appologize for being rude, and thank you for your response.
    The reason I did not respond was that I don't think that your answer solves the question of top level containers (specifically JFrame). I have been researching the net and some of the text books to come up with an answer before I respond. To this point, I believe that the answer has something to do with changing the boundary. If this is the case I'm within four or five hours of the solution, and will publish. If not, back to the drawing board.

  • On the most upper left of the Title Bar (the part where the x box is on the right side) where the Firefox icon should be (on the upper left corner) I have a printer icon instead. Why did that happen and how do I change it? Thanks for any help.

    On the most upper left of the Title Bar (the part where the x box is on the right side) where the Firefox icon should be (on the upper left corner) I have a printer icon instead. Why did that happen and how do I change it? Thanks for any help.

    I don't actually have an answer for you, but ditto on changing things that aren't broken. Drives me crazy!!

  • How to change the position of the title bar in XFCE?

    I hate widescreens, but I bought one because only those are sold. There's a problem with them - The amount of text you can fit on the screen horizontally is quite low which means less lines of text and more scrolling. Also, I noticed that at least 50px is taken up by misc title bars and menus. There would be much more space if I got rid of them.
    Unfortunately, getting rid of them is not an option. I need them. I was thinking that it perhaps would be possible to move the title bars of the windows to the side of the window. Mockup of how it would work included. Do you know of any such solution? That would really help.
    Mockup: http://yfrog.com/j4screenshotesp

    Already been requested ( http://xfce.wikia.com/wiki/Wish_List ) but not yet available AFAIK.

Maybe you are looking for

  • Trying to install Windows 8.1 from an ISO, but boot camp assistant doesn't seem to recognize

    Hi there, I have a 2011 Macbook pro, 15", 2.2 GHz Intel Core i7, 8GB RAM. I'm wanting to install windows 8.1 using boot camp assistant, and downloaded windows 8.1 from dreamspark (Microsoft store for students). I have downloaded all of the windows su

  • Apps take a long time to open on mac?

    I have a June 2012 Macbook pro (15 inch base model-nonretina). Apps take ridiculously long to open in OSX (Mountain Lion). When I use bootcamp to go into Windows 7, however, my computer is fast, apps open quickly, and games run on high. It doesn't ma

  • Why did my iPod stop working?

    My new fifth gen ipod is barely a few weeks old and already is having trouble. Previously it wouldn't turn on, and resetting it worked, but now the same thing is happening but without anything working. I tried the five R's and EVERYTHING else the app

  • Deleting the request from BW is required or not.......?

    Hi All, I am working on FI and PP, I have loaded Master and Transaction Data using the Standard Datasources from R/3 Development System to the BW Dev Standard Data Targets.... In BW Data Targets data is filled with R/3 Development data.... Yesterday

  • What format are podcasts? where? what? how to save and share? ...

    As someone who can't even spell MP3 I'm starting at a basic question -- what is a podcast? I don't mean "what" as in concept but "what" as in what format? where does it live on my computer? how would I include a podcast in a playlist? etc. Any "Podca