* Add png support for menu icon
* A better logout menu icon * Reduce missing menu icon log level from SEVERE to WARNING
This commit is contained in:
parent
5c03ba3cb6
commit
e11381a8b8
|
@ -1279,7 +1279,26 @@ public final class Env
|
||||||
URL url = Adempiere.class.getResource("images/" + fileNameInImageDir);
|
URL url = Adempiere.class.getResource("images/" + fileNameInImageDir);
|
||||||
if (url == null)
|
if (url == null)
|
||||||
{
|
{
|
||||||
s_log.log(Level.SEVERE, "Not found: " + fileNameInImageDir);
|
s_log.log(Level.WARNING, "Not found: " + fileNameInImageDir);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new ImageIcon(url);
|
||||||
|
} // getImageIcon
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get ImageIcon. Will try .gif then .png
|
||||||
|
*
|
||||||
|
* @param fileName file name in imgaes folder without the extension(e.g. Bean16)
|
||||||
|
* @return image
|
||||||
|
*/
|
||||||
|
public static ImageIcon getMenuImageIcon (String fileName)
|
||||||
|
{
|
||||||
|
URL url = Adempiere.class.getResource("images/" + fileName+".gif");
|
||||||
|
if (url == null)
|
||||||
|
url = Adempiere.class.getResource("images/" + fileName+".png");
|
||||||
|
if (url == null)
|
||||||
|
{
|
||||||
|
s_log.log(Level.WARNING, "GIF/PNG Not found: " + fileName);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new ImageIcon(url);
|
return new ImageIcon(url);
|
||||||
|
|
Loading…
Reference in New Issue