java - Images are not appearing in RCP application after exporting as a product -
i have rcp application, in have added images icons. below method method adding icons on buttons:
public static void seticonforbutton(button button, display d, bundle bundle, string path) { inputstream = null; try { = filelocator.openstream(bundle, new path(path), false); image image = new image(d, is); button.setimage(image); } catch (ioexception e1) { e1.printstacktrace(); } { try { if (is != null) { is.close(); } } catch (exception e1) { e1.printstacktrace(); } } }
where,
button button
--> button on need add icons,
display d
--> current display,
bundle bundle
--> frameworkutil.getbundle(getclass());,
string path
--> path of icon.(for example - /icons/expandall.gif)
all images stored in icons
folder directly under root project folder.
note: have no other references anywhere else in whole project of icons folder.
have added icons in build.properties ? must open plugin.xml instance, go build tab, , check "icons" folder in "binary build" section indicates folder bundled in rcp application or plugin.
hope helps.
Comments
Post a Comment