NetBeans Cheat Sheet

Below is a cheat sheet for NetBeans, an integrated development environment (IDE) primarily used for Java development:

Navigation and General Usage

  • Open/Close a Project:
    • Open Project: File > Open Project…
    • Close Project: Right-click on the project in the Projects window > Close Project.
  • Code Navigation:
    • Use Ctrl+Click to navigate to the definition of a class or method.
  • Toggle Line Comment:
    • Ctrl + / (Windows/Linux) or Cmd + / (Mac) to toggle line comments.
  • Toggle Block Comment:
    • Ctrl + Shift + / (Windows/Linux) or Cmd + Shift + / (Mac) to toggle block comments.

Editing and Code Generation

  • Code Completion:
    • Ctrl + Space to activate code completion.
  • Generate Code:
    • Alt + Insert to generate code (getters, setters, constructors, etc.).
  • Rename Refactoring:
    • Shift + F6 to rename a class, method, or variable.
  • Surround with Code Block:
    • Alt + Shift + T to surround selected code with a code block.

Running and Debugging

  • Run Project:
    • F6 to build and run the selected project.
  • Debug Project:
    • F5 to start debugging.
  • Add Breakpoint:
    • Ctrl + F8 (Windows/Linux) or Cmd + F8 (Mac) to add/remove a breakpoint.

Version Control (Git)

  • Git Menu:
    • Team > Git to access Git features.
  • Commit Changes:
    • Team > Commit to commit changes to the repository.

Testing

  • JUnit Support:
    • NetBeans supports JUnit for unit testing. Use the “Test” menu.

GUI Design (JavaFX)

  • JavaFX Scene Builder:
    • Integrate JavaFX Scene Builder for GUI design.

Project Management

  • Project Properties:
    • Right-click on the project > Properties for project-specific configurations.
  • Clean and Build:
    • F11 to clean and build the project.

Shortcuts and Tips

  • Navigate to Class:
    • Ctrl + O (Windows/Linux) or Cmd + O (Mac) to navigate quickly to a class.
  • Search Everywhere:
    • Double-press Shift to search everywhere (files, actions, etc.).
  • Show/Hide Navigator Window:
    • Ctrl + 7 (Windows/Linux) or Cmd + 7 (Mac) to show/hide the Navigator window.

Online Resources

Java EE and Web Development:

  1. Java EE Support:
    • NetBeans provides support for Java EE applications.
  2. Web Development:
    • Use NetBeans for developing web applications (HTML, CSS, JavaScript).

Remember to check the official NetBeans documentation and community forums for the latest updates and tips. NetBeans is versatile and supports various languages and frameworks beyond Java.