Then, when you choose this new item in a Java file...
...the following dialog box appears to tell you where you should go look for your file:
When you go to the specified folder, you'll either find a PDF containing the entire file or only the selected part of the file. (This was Andrei's suggestion. Initially, I had two separate menu items, one for the entire file and another for a selection. Andrei suggested that having one menu item might be more useful, because it would mean that the user would have to do less work, it means that you don't need to manually force the IDE to create one or the other, the IDE now just creates one or the other automatically depending on whether you've made a selection or not.)
And this is what my Projects window looks like, i.e., these are the files needed for integrating iText into NetBeans IDE:
So if you're reading this and are thinking to yourself: "Hmmm. I'd like to be able to generate PDF files from my Java files in the NetBeans Editor", then please drop me a line and I'll send you the modules (one for installing the iText JAR file and the other for accessing its methods and providing the functionality). A few test drives would be good. After that maybe it should be sent to http://www.nbextras.org.
I'd like to extend this module in several ways. For one thing, I'd like the PDF file to open automatically as soon as it is created. Must be some method in iText to allow me to do that. Secondly, I'd like the user to be able to set the font and color of the generated PDF file. That shouldn't be hard to do, something I could combine with the options window extension.