Don't use a design tool to create the GUI. Its sounds like Netbeans is using a absolute layout which is not what your want.
Use a proper layout manager. Maybe a FlowLayout
that is right aligned
.
Read the section from the Swing tutorial on How to Use Flow Layout for more information and working examples.