O'Reilly logo

NetBeans IDE 8 Cookbook by Rhawi Dantas, David Salter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Toggling comments

When writing code, it is sometimes useful to comment out code to see what effect it will have on a running application while still keeping the original code. NetBeans provides an easy way to comment out and remove comments from multiple lines of code as seen in this recipe.

Getting ready

To complete this recipe, you need to have a NetBeans project with some Java code in it that can be commented out. If you do not have a suitable project, you can create one using any of the recipes in Chapter 1, Using NetBeans Projects, of this book.

How to do it…

  1. Using the mouse, click on a single line of code within a Java source file.
  2. Press Ctrl + Shift + C.
  3. Note that the commenting state of the line you have selected is toggled. That is, if you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required