Java tutorial
import javax.swing.Icon; import javax.swing.UIManager; public class Main { public static void main(String[] argv) throws Exception { } public static Icon getIconForType(int iconType) { switch (iconType) { case 0: return UIManager.getIcon("OptionPane.errorIcon"); case 1: return UIManager.getIcon("OptionPane.informationIcon"); case 2: return UIManager.getIcon("OptionPane.warningIcon"); case 3: return UIManager.getIcon("OptionPane.questionIcon"); } return null; } }