Source

jackpot30-demo-examples / test / META-INF / upgrade / j.s.ImageIcon.test

Full commit
%%TestCase imageIconForImage
package test;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import org.openide.util.ImageUtilities;

public class Test {

    public Icon getIcon() {
        return new ImageIcon(ImageUtilities.loadImage("/icon/location.png"));
    }
}
%%=>
package test;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import org.openide.util.ImageUtilities;

public class Test {

    public Icon getIcon() {
        return ImageUtilities.image2Icon(ImageUtilities.loadImage("/icon/location.png"));
    }
}
%%TestCase imageIconForFileName
package test;

import java.net.URL;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import org.openide.util.ImageUtilities;

public class Test {

    public Icon getIcon() {
        return new ImageIcon("/file/name.png"));
    }
}