Java Placing Frame Icon

Java Placing Frame Icon

Java Placing Frame Icon

Summary: Learn in this tutorial "Java Placing Frame Icon", how to place your own icon on the frame (in place of default coffee cup) title bar.

In the following program, our own choice of icon (bird) is placed on the frame title bar. It replaces the default coffee cup. The frame is also made non-resizable with setResizable() method.

Java Placing Frame Icon

Observe the bird image on the title bar.

Any image to be placed on the frame should be converted into an object of java.awt.Image class. The image object is returned by getImage() method of Toolkit class.

The above statement makes the frame non-resizable by the user.

All the remaining code is as usual.

4 thoughts on “Java Placing Frame Icon

Leave a Reply

Your email address will not be published. Required fields are marked *