When I convert my project into runnable jar the same system, the image is loading in the output. But when I tried in another system, the image failed to load? how to give the image URL rather then using c: ?please help on this?
JToolBar toolbar = new JToolBar("Toolbar", JToolBar.HORIZONTAL);
JButton capturebut = new JButton(new ImageIcon("C:\\sampleprojects\\
compare\\shankar\\src\\capture.gif"));
capturebut.setToolTipText("Capture");
toolbar.add(capturebut);
Use
getResourceAsStreamhttp://download.oracle.com/javase/tutorial/uiswing/components/icon.html
http://www.jugpadova.it/articles/2006/02/05/accessing-a-resource-within-a-jar