Reputation: 15
I am writing Java class file using NetBeans and I use ALT+SHIFT+F for auto formatting.However, This is not wrapping the code to be printable in single page.
How to change customize Formatting settings so that when i do auto formatting the code gets formatted as such it can be printable in single page?
Upvotes: 0
Views: 1230
Reputation: 7008
There are a couple of different ways to handle this:
If you go to Tools
-> Options
, Select Editor
at the top and the Formatting
tab, select Java
in the Language
drop-down list and Wrapping
in the Category
drop-down list. There are many options that make the auto-formatting break more lines by switching (Never
to either Always
or If Long
) which would keep line lengths shorter but still not guarantee that a really long line doesn't extend off the page. It would probably have to break the syntax of Java in order to always be able to break those lines.
Another option would be to leave auto-formatting alone and just adjust the Print options. Select the text file. Go To File -> Print .... On the first dialog click Print Options
. On that dialog click the Wrap Lines
checkbox and/or change the zoom to print in fewer pages.
Upvotes: 1