NetBeans FAQs

Initializing Icons from files/Get file URLs

Gonzales had problems loading Icons from programs run with Netbeans.

	icon = new ImageIcon("images/right.gif") 

You need to do the following instead

icon = new ImageIcon(getURL("images/right.gif")) 

where getURL is defined as

protected URL getURL(String name) {

if (name != null) {
	URL url = this.getClass().getResource(name);
	return url;
}
	return null;
}

Beautifying Java Code

Jalopy has a plug-in for NetBeans that works well and is highly configurable. I

Warning: Jalopy does not override the "Reformat Code" item in the context sensitive popup menu. You need to run it from the Build menu.