Change Application Icon in Desktop Application

View: New views
2 Messages — Rating Filter:   Alert me  

Change Application Icon in Desktop Application

by giorgiolaner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,
I'm relatively new to netbeans, I just want to change the Java "coffee" icon from my application with another icon...
I tried the following code from my FrameView:


JFrame mainFrame = GeoJaxConfiguratorApp.getApplication().getMainFrame();
ImageIcon imageIcon = new ImageIcon("C:\\iconCheckAll.gif");
mainFrame.setIconImage(image.getImage());

But it doesn't work... what is the problem?

Regards,

Giorgio


Nuova grafica e nuove funzionalità! Crea subito Gratis la tua nuova Casella di Posta Katamail

Re: Change Application Icon in Desktop Application

by Sean Carrick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



giorgiolaner@... wrote:
>
> JFrame mainFrame = GeoJaxConfiguratorApp.getApplication().getMainFrame();
> ImageIcon *imageIcon* = new ImageIcon("C:\\iconCheckAll.gif");
> mainFrame.setIconImage(*image*.getImage());
>
Look again at your code.  You declare an ImageIcon variable named
"imageIcon" and then attempt to assign "image.getImage()" to the frame's
icon  property.  "image" was never declared.

--

Cheers,

Sean Carrick
PekinSOFT Systems
sean@...
http://www.pekinsoft.net

----------------------------------
Proud to be 100% Microsoft free...
----------------------------------