icon change

Discussion in 'Java' started by bob smith, Jan 17, 2013.

  1. bob smith

    bob smith Guest

    I have a Swing app, and I want to change the icon that shows in the bottom bar when it runs.

    Anyone know how to do that?

    Right now, it's a coffee cup.
    bob smith, Jan 17, 2013
    #1
    1. Advertising

  2. bob smith

    FredK Guest

    On Thursday, January 17, 2013 11:21:41 AM UTC-8, bob smith wrote:
    > I have a Swing app, and I want to change the icon that shows in the bottom bar when it runs. Anyone know how to do that? Right now, it's a coffee cup.


    frame.setIconImage(image);
    FredK, Jan 17, 2013
    #2
    1. Advertising

  3. bob smith

    bob smith Guest

    On Thursday, January 17, 2013 1:32:12 PM UTC-6, FredK wrote:
    > On Thursday, January 17, 2013 11:21:41 AM UTC-8, bob smith wrote:
    >
    > > I have a Swing app, and I want to change the icon that shows in the bottom bar when it runs. Anyone know how to do that? Right now, it's a coffee cup.

    >
    >
    >
    > frame.setIconImage(image);


    Thanks.

    That seems to work on Windows, but not on Mac.
    bob smith, Jan 17, 2013
    #3
  4. bob smith

    Roedy Green Guest

    On Thu, 17 Jan 2013 11:21:41 -0800 (PST), bob smith
    <> wrote, quoted or indirectly quoted someone
    who said :

    >I have a Swing app, and I want to change the icon that shows in the bottom bar when it runs.
    >
    >Anyone know how to do that?


    I don't know about that particular icon, but in general you change
    those sorts of thing by changing the Look and Feel or writing your own
    L&F or writing one that modifies another.

    See http://mindprod.com/jgloss/laf.html
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    The first 90% of the code accounts for the first 90% of the development time.
    The remaining 10% of the code accounts for the other 90% of the development
    time.
    ~ Tom Cargill Ninety-ninety Law
    Roedy Green, Jan 17, 2013
    #4
  5. bob smith

    bob smith Guest

    On Thursday, January 17, 2013 3:23:49 PM UTC-6, Steve W. Jackson wrote:
    > In article <>,
    >
    > bob smith <> wrote:
    >
    >
    >
    > > On Thursday, January 17, 2013 1:32:12 PM UTC-6, FredK wrote:

    >
    > > > On Thursday, January 17, 2013 11:21:41 AM UTC-8, bob smith wrote:

    >
    > > >

    >
    > > > > I have a Swing app, and I want to change the icon that shows in the

    >
    > > > > bottom bar when it runs. Anyone know how to do that? Right now, it's a

    >
    > > > > coffee cup.

    >
    > > >

    >
    > > >

    >
    > > >

    >
    > > > frame.setIconImage(image);

    >
    > >

    >
    > > Thanks.

    >
    > >

    >
    > > That seems to work on Windows, but not on Mac.

    >
    >
    >
    > That's because the Windows task bar automatically picks up the frame's
    >
    > icon, whereas the Mac OS X environment uses a totally different
    >
    > technique. It's picking up the icon of the application actually
    >
    > running, which is Java itself. To change that, you'll have to learn how
    >
    > to "bundle" a Mac app.
    >
    > --
    >
    > Steve W. Jackson
    >
    > Montgomery, Alabama




    Yeah, I figured out how to bundle a Mac app.

    I guess I was hoping though to have a single JAR file that would be icon-correct on Windows and Mac.
    bob smith, Jan 17, 2013
    #5
  6. bob smith

    FredK Guest

    On Thursday, January 17, 2013 2:42:25 PM UTC-8, bob smith wrote:
    > On Thursday, January 17, 2013 3:23:49 PM UTC-6, Steve W. Jackson wrote: >In article <>, > > bob smith <> wrote: > > > > > On Thursday, January 17, 2013 1:32:12 PM UTC-6, FredK wrote: > > > > On Thursday, January 17, 2013 11:21:41 AM UTC-8, bob smith wrote: > > > > > > > > > I have a Swing app, and I want to change the icon that shows in the > > > > > bottom bar when it runs. Anyone know how to do that? Right now, it's a > > > > > coffee cup. >> > > > > > > > > > > > > > > frame.setIconImage(image); > > > > > > Thanks. > > > > > > That seems to work on Windows, but not on Mac. > > > > That's because the Windows task bar automatically picks up the frame's > > icon,whereas the Mac OS X environment uses a totally different > > technique. It's picking up the icon of the application actually > > running, which is Java itself. To change that, you'll have to learn how > > to "bundle" a Mac app. > > -- > > Steve W. Jackson > > Montgomery, Alabama Yeah, I figured out how to bundle a Mac app. I guess I was hoping though to have a single JARfile that would be icon-correct on Windows and Mac.


    Note that frame.setIconImage(image) also works with most Unix and Linux window managers.
    FredK, Jan 18, 2013
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miro Durcik

    app.rc resource's icon to .net Icon

    Miro Durcik, Oct 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,380
    Miro Durcik
    Oct 9, 2004
  2. =?Utf-8?B?UHN5Y2hv?=

    Change IE icon

    =?Utf-8?B?UHN5Y2hv?=, Oct 15, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    566
    Greg Burns
    Oct 15, 2004
  3. Replies:
    1
    Views:
    3,954
    Thomas Weidenfeller
    Mar 31, 2005
  4. Dan Polansky
    Replies:
    3
    Views:
    786
    Larry Barowski
    Feb 12, 2007
  5. Bodi
    Replies:
    1
    Views:
    270
    Lasse Reichstein Nielsen
    Nov 18, 2003
Loading...

Share This Page