NetBeans Tips

Installing and starting NetBeans

Installing and starting NetBeans

A great guide to installing and using NetBeans

Getting the NetBeans IDE

If you feel adventurous, you could also setup your own IDE development environment such as Eclipse, NetBeans, or the regular JDK to develop your programs on your own PC. However, please be aware that if you download your own copy for your own computer, you will be on your own without support for any installation problems as well as for any troubleshooting problems. Installing your own distro and/or Java development environment is certainly an excellent pedagogical tool but ONLY if you are willing to do your own support.

That being said, if you do feel ambitious, here are two excellent videos showing how to download and run NetBeans for Java: https://www.youtube.com/watch?v=DubAg24zLb8 and https://www.youtube.com/watch?v=BXMp0xmrZps. The steps, in brief, are as follows:

  1. Download the Java + NetBeans Bundle called "Java SE and NetBeans CoBundle" from here: https://www.oracle.com/technetwork/java/javase/downloads/jdk-netbeans-jsp-3413139-esa.html


  2. On the next screen, Download the version of the bundle appropriate for your Operating System and install it
  3. Launch the NetBeans IDE and create your first project!


Getting Started with NetBeans

attribution to Frederic

Getting a handle on the User Interface

NetBeans Interface Tips

Managing files, classes, etc.

  1. Adding a class to a project How to add a new class (or file) to a NetBeans project
  2. Running Java Programs Great reference detailing how to run the whole project or an individual file
  3. Rename a class How to rename (or refactor) a class, variable, etc. (refactoring/renaming a class automatically changes the .java file's name appropriately for you!)

General Tips

  1. NetBeans Project Management: Start new projects and choose Properties->Run to set main class
  2. Java Tips: scan.nextInt() doesn't flush buffer so issue a scan.nextLine() after it
  3. NetBeans Project Files Location Where does NetBeans store its project files?

Shortcuts in NetBeans

  1. Type sout and hit TAB for System.out.println();
  2. Type psvm and hit TAB for public static void main(String args[]) {}

NetBeans Configuration

  1. Incorporating Images: To incorporate images into your NetBeans project (as opposed to other IDEs like Eclipse), either put them in the project's root folder or add a folder of type resources or images and then put the image there (in Eclipse you can put it directly in src). Or use ImageIcon fillingIcon = new ImageIcon(getClass().getClassLoader().getResource("filling.jpg")); to do it in a package independent way (in a static method, use CLASSNAME.class. instead of getClass().).
  2. Code Completion (pre-v8): Unlike other IDEs like Eclipse, NetBeans makes you press CTRL-SPACE in order to do code completion. In order to have code completion occur automatically as you type, you can go to Tools -> Options -> Editor -> Code Completion, choose Java as your Language, and then check the Auto Popup on Typing Any Java Identifier Part checkbox. If you further set the Completion Selectors to [.,;:([+-=] (note the extra space at the end), you will get completion for both variables and methods, as well.

Ricky J. Sethi, PhD <rickys@sethi.org>
Last updated: Wednesday, October 3 2018
(sethi.org/tutorials/tips_netbeans.shtml)