iconmanager.java
来自「MyUploader 是一款使用 http 协议(RFC 1867)用于上传文件」· Java 代码 · 共 48 行
JAVA
48 行
/* * Copyright 2006-2007 JavaAtWork All rights reserved. * Use is subject to license terms. */package javaatwork.myuploader.utils;import java.net.MalformedURLException;import java.net.URL;import javax.swing.ImageIcon;/** * Class for creating an ImageIcon. * * @author Johannes Postma */public class IconManager { /** * Creates a new ImageIcon. * * @param value The name of the icon. * @param codeBase The codebase of the applet. * @return The ImageIcon. */ public synchronized static ImageIcon getImageIcon(String value, URL codeBase) { if (value == null) { return null; } URL iconURL = null; try { if (!value.startsWith("http")) { iconURL = new URL(codeBase, value); } else { iconURL = new URL(value); } } catch (MalformedURLException e) { Logger.log("IconManager", "getImageIcon()", "Incorrect URL format: " + value + " " + e.toString()); } return iconURL == null ? null : new ImageIcon(iconURL); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?