See:
"Hello World!" for the NetBeans IDE (The Java™ Tutorials > Getting Started > The "Hello World!" Application)