I told you in this tutorial about how to make an RPM package.
Also, I told you how to use Netbeans IDE.
Today I will show how to make these settings.
First, you will need to make the application working well.
Then you need to go on to project and press click right with your mouse.
Set your package like in the next image:
Now you can build your RPM package for your distro, see the next image: