Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Word-wrapping comments in Netbeans

/*
 *
 * This is a long comment. I broke it into lines, but that made it impossible to edit without screwing up the formatting. Is there a way to make Netbeans add line breaks automatically?
 *
 */

Reads: This is a long comment. I broke it into lines, but that made it impossible to edit without screwing up the formatting. Is there a way to make Netbeans add line breaks automatically?

like image 697
Emanuil Rusev Avatar asked Aug 19 '11 11:08

Emanuil Rusev


People also ask

What is word wrapping in Java?

it is referred to as wrap around and run around, which moves the cursor to the next line when a line of text is filled; therefore, users are not required to press Enter after every line.

How do I turn on word wrap in eclipse?

There is a "Toggle Word Wrap" command hidden in the "Window > Editor" menu (default shortcut is Alt+Shift+Y). Or you can use the Quick Access bar: Ctrl+3, and type wrap.


2 Answers

As for today, the current NetBeans (7.3) word-wraps comments with some nice available extra options when formatting. NB: Unfortunately, this is currently only available for the Java language.

You can launch the formatter with the context menu→Format, or if you did not change the standard shortcuts, Alt+Shift+F should do.

To access the corresponding configuration: ToolsOptionsEditorFormatting; Language: Java; Category: Comments

Netbeans comments formatting options


like image 99
Alberto Avatar answered Oct 04 '22 20:10

Alberto


Your IDE won't format the comment for you. You will have to do it by hand. Yes, that means you have to re-format it once you add new words to it.

like image 35
DarkDust Avatar answered Oct 04 '22 21:10

DarkDust