Java Toolkit.getImage(String filename)
Syntax
Toolkit.getImage(String filename) has the following syntax.
public abstract Image getImage(String filename)
Example
In the following code shows how to use Toolkit.getImage(String filename) method.
// w w w . j av a 2 s .co m
import java.awt.Image;
import java.awt.Toolkit;
public class Main {
public static void main(String[] args) throws Exception{
Image im = Toolkit.getDefaultToolkit().getImage("C:/Java/image.PNG");
}
}
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »