Splitting windows either horizontally or vertically is an excellent way to utilize screen space when it is necessary to compare two sections of a file. Using code folds is another excellent technique for "folding" or "collapsing" sections of code, thus helping to provide more screen space. With a code fold, pressing the + or – buttons on the left-hand side margin expands or collapses the code and can, therefore, be used to get more code onto the current view of a file.
Creating a code fold is simply a matter of placing an especially formatted comment around the piece of code that requires folding, as shown in the following code snippet:
// <editor-fold desc="Variable definitions"> int foo; String bar; // </editor-fold>
The <editor-fold>
XML defines that the enclosed code will be available within NetBeans as a code fold and has several attributes, all of which are optional:
desc
: It is the description that is displayed within the NetBeans code editor...