Example usage for java.awt Graphics2D finalize

List of usage examples for java.awt Graphics2D finalize

Introduction

In this page you can find the example usage for java.awt Graphics2D finalize.

Prototype

@Deprecated(since = "9")
public void finalize() 

Source Link

Document

Disposes of this graphics context once it is no longer referenced.

Usage

From source file:MyCanvas.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    Image img1 = Toolkit.getDefaultToolkit().getImage("yourFile.gif");
    g2.drawImage(img1, 10, 10, this);
    g2.finalize();
}