How to change TitleBar icon in Java AWT and Swing
The setIconImage() method of Frame class is used to change the icon of Frame or Window. It changes the icon which is displayed at the left side of Frame or Window.
The Toolkit class is used to get instance of Image class in AWT and Swing.
Toolkit class is the abstract super class of every implementation in the Abstract Window Toolkit(AWT). Subclasses of Toolkit are used to bind various components. It inherits Object class.
Example to change TitleBar icon in Java AWT
Output:
Example to change TitleBar icon in Java Swing
Output:
No comments:
Post a Comment