Java Toolkit.getImage(URL url)

Syntax

Toolkit.getImage(URL url) has the following syntax.

public abstract Image getImage(URL url)

Example

In the following code shows how to use Toolkit.getImage(URL url) method.


import java.awt.Image;
import java.awt.Toolkit;
import java.net.URL;
// w w w.j  a  v a  2 s. c om
public class Main {
  public static void main(String[] args) throws Exception{
    URL url = new URL("image address");
    Image im = Toolkit.getDefaultToolkit().getImage(url);

  }
}




















Home »
  Java Tutorial »
    java.awt »




BasicStroke
BorderLayout
CardLayout
Color
Cursor
Desktop
DesktopManager
DisplayMode
EventQueue
FlowLayout
FocusTraversalPolicy
Font
FontMetrics
GradientPaint
Graphics
Graphics2D
GraphicsConfiguration
GraphicsDevice
GraphicsEnvironment
GridBagConstraints
GridBagLayout
GridLayout
Image
ItemSelectable
KeyboardFocusManager
LayoutManager
LayoutManager2
Point
Rectangle
Robot
Shape
SplashScreen
SystemColor
SystemTray
TexturePaint
TrayIcon
Toolkit
Transparency