Setting an image for a swing action :
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
files do not get rendered, only png/jpg.
Is this by design ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…