![netbeans vs jgrasp netbeans vs jgrasp](https://i.ytimg.com/vi/nZo98fED2a4/maxresdefault.jpg)
The table below shows how the private class variables map to the public class properties.
Netbeans vs jgrasp code#
Here's a snapshot of the class (the getter & setter code has been removed from the listing):Ĭopy Code 1: public class LineNumberBuilderġ5: private string GetFormattedLineNumber( int lineNumber, The properties (accessed using the usual "getters" and "setters") hold the values you set in the main window Options fields, as well as the source text you have pasted into the RichTextBox. It contains four properties, one public method, and one private method. The main worker class contained in the downloads for this article is named LineNumberBuilder. The screenshot below shows the converted text: You can then copy and paste the converted text to another application as required. The contents of the main text area will be replaced with the converted, line-numbered text. To convert the text, press the "Add Line Numbers" button. Converted text is placed back into this control.
![netbeans vs jgrasp netbeans vs jgrasp](https://i.pinimg.com/originals/67/b0/b5/67b0b50b7511aec808e38e859f6afc84.jpg)
The main text area contains the source text that is to be converted. Tab to Spaces Padding – this field allows you to specify how many spaces a tab is replaced with if the Convert Tabs to Spaces checkbox is checked.This is useful for formatting purposes if the resulting code is to be copied to a word processing or DTP application and you don’t want to mess around with "complex" tab settings. Convert Tabs to Spaces checkbox – if checked, all tabs will be converted to spaces.Line Number Padding – allows you to specify the number of spaces that will separate the line number from the start of each converted line.The Options fields allow you to specify the following parameters:. The screenshot above displays a lump of code prior to the addition of line numbers.
Netbeans vs jgrasp windows#
In addition, although the line numbering class is presented in the context of a Windows application, the relevant code can easily be used or adapted to provide similar functionality via a web application, web service or whatever. Moreover, I haven't added any file I/O operations to the app (Open, Save, etc.) as personally I don't need it – but you may want to do that. As a result, this article concentrates on this class rather than on any other standard application functionality (Cut-Copy-Paste, etc.). BackgroundĪlthough the utility is presented as a simple application to which you can add additional bits and pieces as required, the guts of the line numbering functionality reside in a simple class that contains only two methods. This has saved me a lot of time and effort, particularly as I'm currently writing a book that includes a lot of code examples. You can copy a code snippet (or any text, in fact) into a RichTextBox in the application, press a button to add line numbers, and the formatted, line-numbered code comes out the other end in the wink of an eye. The code in this little utility provides that functionality. It would be handy to be able to quickly and easily add line numbers to the particular code snippet, paste it into my document, and refer to "lines 27-33" instead. Invariably, I end up referring to a particular section of code as "starting from the 27th line from the top, ending at the 33rd line, inclusive" or some such convolution. I sometimes need to include source code in a document or report in order to walk the reader through that code.