
package visualizer.scd.image;

import java.awt.*;
import java.net.*;
import javax.swing.*;

public class ImageLoader
{
    public static Icon getIcon(String s)
    {
        ImageIcon imageicon = null;
        
        try
        {
            URL url = ImageLoader.class.getResource(s);
            imageicon = new ImageIcon(url);
        }
        catch(Exception _ex)
        {
            System.err.println("Problem loading icon: " + s);
        }
        
        return imageicon;
    }

    public static Image getImage(String s)
    {
        Image image = null;
        
        try
        {
            URL url = ImageLoader.class.getResource(s);
            image = Toolkit.getDefaultToolkit().getImage(url);
        }
        catch(Exception _ex)
        {
            System.err.println("Problem loading image: " + s);
        }
        
        return image;
    }
}
