设置 Swing 动作的图像:
Action action = ...
// ImageIcon icon = new ImageIcon(getClass().getResource("/icon.ico"));
ImageIcon icon = new ImageIcon(getClass().getResource("/icon_16x16.png"));
action.putValue(Action.SMALL_ICON, icon);
*.ico
文件不会被渲染,只有png/jpg能够。
这是设计意图吗?