I want to use the following js function to insert an image on a webpage, but I am not referencing the icon file correctly.
function insertWarningIcon(value){
return "<img src='/icons/Warning-icon.png' width='25%' height='25%' />";
}
The image is contained in a java package ‘icons.’ The file’s path is:
C:\Users\XXXX\Documents\NetBeansProjects\distributedTaskMonitor\src\java\icons\Warning-icon.png
The html file’s path is:
C:\Users\XXXX\Documents\NetBeansProjects\distributedTaskMonitor\web\gridMain.html
you can’t point to src package from web pages, you have to put them into “WebContents” folder (it’s outside of src folder)
eg.
is