package edu.unl.consystlab.gui;

import java.applet.Applet;
import java.awt.Component;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JScrollPane;

public class ImageComponent {
    
    private ImageComponent()
    {
        // no constructor
    }
    
    public static Component getScrollable(Image image)
    {
        ImageIcon icon = new ImageIcon(image);
        JLabel label = new JLabel(icon);
        JScrollPane scroll = new JScrollPane(label);
        return scroll;
    }
    
    public static Component getScrollable(String name, Applet a)
    {
        Image image = a.getImage(a.getCodeBase(), name);
        return getScrollable(image);
    }

    
}