Skyrim Mod:SkyProc/NetBeans

Mod / Skyrim: Skyrim Mod: SkyProc

NetBeans TricksEdit

Auto ImportingEdit

Ctrl-Shift-I

When using new types of Objects in your code, something you'll get the "cannot find symbol" error. This means that you have not imported the external code about that object. Normally you would have to research what package that Object was from, and type "import ..." at the top of your file.

NetBeans will do all of this automatically. Whenever you see that error, just do Ctrl-Shift-I, and it will fix all imports for you. (Unless you referenced an Object that doesn't exist, or spelled it wrong)

RefactoringEdit

Ctrl-R

Refactoring is kind of like find/replace, without the risk of accidentally replacing something unintentially or missing a replacement. If you named a global variable "Banana" and used it 1000 times, only to realize you wanted it named "Orange", you can refactor it and Netbeans will automatically look through all your code and rename it where appropriate: Even if there are other variables named "Banana" in your code!

Don't ever do a replace, always refactor.

Code MinimizingEdit

Tools->Options->Editor->Code Folding

When you have a large amount of code, functions, and comments, this becomes useful by automatically minimizing everything so you can quickly scroll down to the function you care about.

Smart Hints / Error CorrectionEdit

Right click error/hint icons

NetBeans, like many other IDEs, will let you know when things are wrong. It will also give smart hints, recommending better ways to do things.

The best part, though, is that it also will make the corrections/suggestions FOR you if you right click the error/hint icon and click on the suggestion.

Jumping to the SourceEdit

Ctrl-Click

If you are wondering where a variable was declared, or where a function's code is, just Ctrl-click and Netbeans will take you straight there.

Commenting In/OutEdit

Ctrl-/

Comments out (or in) the current lines selected.

Formatting IndentationEdit

Ctrl-F

Will automatically clean up your code.

Automatically Write CodeEdit

Right Click -> Insert Code

NetBeans can actually do a lot of automatic code generation. It can automatically generate constructors, overwrite functions, equals functions taking in your custom fields, etc.