Changing system menu icon of JFrame

Posted on 2000-04-06
Last Modified: 2008-01-16

I would like the icon for the system menu of a JFrame changed to my own custom icon. What I need to know is what kind of image file I need for the icon. Can a .GIF file do? And what resolution should it be?

Also, suppose my java application runs on a Windows system, and I want to create a custom desktop icon to launch my application. How do I make that icon? From what I can tell from a normal .EXE program, the icon is stored inside the .EXE file.
Question by:yongsing
  • 3
LVL 16

Accepted Solution

heyhey_ earned 20 total points
ID: 2692190
ImageIcon icon = new ImageIcon("system.gif");

Author Comment

ID: 2692765
But what pixel resolution should the system.gif file be? Should it be 16 x 16 or 32 x 32?
LVL 16

Expert Comment

ID: 2692933
I suppose that the image will be automatically resized ...

public synchronized void setIconImage(Image image)

Sets the image to display when this frame is iconized. Not all platforms support the concept of iconizing a window.

image - the icon image to be displayed

Expert Comment

ID: 2692947
You can use frame.getIconImage() to get the default one and check its size, but there are probably better solutions :-)
LVL 16

Expert Comment

ID: 2693086

well, actually I don't remember the size ... :) but I suppose that every Image object will be automatically resized.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 104
session migration servlets 2 42
type mismatch (Object[] to double[] 4 33
ejb mdb examples 1 8
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question