dshrenik
asked on
Swing: Change icon
Is it possible to change the icon that appears at the top-left corner of the title bar in any Swing window? By default, it is the java logo.
If yes, please let me know how. Thanks!
If yes, please let me know how. Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The above code is in the constructor of my class that extends JFrame?
Yes, exactly
http://www.java-forums.org/awt-swing/5373-how-change-window-icon.html
In the Netbeans properties window for your form, try iconImage. Otherwise, try:
Java Code:
1
2
Image icon = Toolkit.getDefaultToolkit(
frame.setIconImage(icon);