-
window icon
Hi everyone, I need to set an image to the window of my application
I've heard it is this way
frame.setIconImage(new ImageIcon(imgURL).getImage());
but not working, I know setIconImage needs an Image as a parameter, but I don't know how to create it because nowhere it asks for the location of my image
another question:is the window icon (in the upper-left) the same as the task bar icon, or do I have to set two differents sized icons?
thanks!
-
Re: window icon
-
Re: window icon
the java tutorials website is down :(
I changed imgUrl with "/resources/icon.png" but when I run it, it doesnt shows up, thought maybe png format wasnt supported but neither is gif, so I think there is something wrong with the code.
meanwhile I want to add copy-to-clipboard functionality to a JMenuItem, I tried something with setAction and DefaultEditorKit.copyAction but can't figure it out, any ideas?
thanks kevin
ADDED: java tutorials website's up :)
-
Re: window icon
What happens if you use the full path?
-
Re: window icon
how do I put the full path? like "C:\Users\user\Documents\NetBeansProjects\project\ src\resources\img.png" ? I tried creating an Image object and thus, set the image to the frame but didnt work because cant create an Image object.
-
Re: window icon
Yeah, that looks like a full path.
Unfortunately, if you want more help, you're going to have to post an SSCCE (which in your case should only be a few lines) so I can see exactly what you're trying to do.
-
Re: window icon
ok problem solved, the absolutepath was C: so I need to move my icon to C:\resources\icon.gif or put the full path
thanks!