Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Lourdes Edwards   on Oct 14 In Java Category.

  
Question Answered By: Jeffrey Washington   on Oct 14

If you know the exact URL for the image you wish to
load, you can load  it with the getImage() method:

URL imageURL = new URL("http://www.xyz.com/logo.gif");
java.awt.Image img = this.getImage(imageURL);

You can compress this into one line as follows
Image img = this.getImage(new
URL("http://www.xyz.com/logo.gif"));

The getImage() method is provided by
java.applet.Applet. The URL class  is provided by
java.net.URL. Be sure to import  it.

Share: 

 

This Question has 7 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on My first Applet have a problem Or get search suggestion and latest updates.


Tagged: