Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   icon change (http://www.velocityreviews.com/forums/t956622-icon-change.html)

bob smith 01-17-2013 07:21 PM

icon change
 
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.

FredK 01-17-2013 07:32 PM

Re: icon change
 
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);

bob smith 01-17-2013 09:08 PM

Re: icon change
 
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.

Roedy Green 01-17-2013 10:18 PM

Re: icon change
 
On Thu, 17 Jan 2013 11:21:41 -0800 (PST), bob smith
<bob@coolfone.comze.com> 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

bob smith 01-17-2013 10:42 PM

Re: icon change
 
On Thursday, January 17, 2013 3:23:49 PM UTC-6, Steve W. Jackson wrote:
> In article <3cfa1dd3-163c-479a-ad66-99a49664f4c5@googlegroups.com>,
>
> bob smith <bob@coolfone.comze.com> 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.

FredK 01-18-2013 04:30 PM

Re: icon change
 
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 <3cfa1dd3-163c-479a-ad66-99a49664f4c5@googlegroups.com>, > > bob smith <bob@coolfone.comze.com> 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.


All times are GMT. The time now is 03:02 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.