new ImageIcon(String filename) : ImageIcon « javax.swing « Java by API






new ImageIcon(String filename)

  
import java.awt.Image;

import javax.swing.ImageIcon;

public class Main {

  public static void main(String[] a) {
    ImageIcon imageIcon = new ImageIcon("yourFile.gif");
    Image image = imageIcon.getImage();

  }

}

   
    
  








Related examples in the same category

1.ImageIcon: getImage()
2.ImageIcon: setDescription(String description)