I'm looking for a keyboard shortcut to move a line up or down.

Equivalent to Eclipe's Alt+up/Alt+down.


I can't seem to find a similar one in NetBeans.


Is this feature hidden somewhere?

4 Answers 4



Alt + Shift + up/down

So quite similar to eclipse


For those who use Linux, Alt + Shift + up/down could be a shortcut for changing windows, so instead Alt+Shift+Page Up or Page Down


On Mac with NetBeans 8.2 the shortcuts are a little different:

Alt + Shift + up/down  -it duplicates the line
Ctrl + Shift + up/down  -it moves the line

Just click on the "Source" menu, in the menu bar, and look for the items "Move Up" and "Move Down" or "Move Code Element Up" and "Move Code Element Down". They should show the shortcut/accelerator for your platform.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.