In order to uninstall NetBeans and GlassFish
GLASSFISH
If you want to uninstall Glassfish only.
Open Control Panel from Start Menu -> Control Panel
Under Programs catagory choose Uninstall a program, a window will open displaying installed programs
find “Glassfish Server Open Source Edition” and right click on it, a dropdown menu will open with option click Uninstall/Change.

Click Uninstall button to uninstall “Glassfish Server Open Source Edition” from your computer.

Click Finish to finish the process.
NETBEANS:
Open Control Panel from Start Menu -> Control Panel
Under Programs category choose Uninstall a program, a window will open displaying installed programs
find “NetBeans” and right click on it, a dropdown menu will open with option click Uninstall/Change.

A dialog box will appear, displaying installed java components. choose the components by checking the checkboxes of components you want to uninstall.

Click uninstall button on the bottom of the dialog box.
It will delete all the components and directories installed by NetBeans.

click finish to complete the process.

By uninstalling NetBeans will not delete the projects you created.
They are located in “Documents” of computer, you can access and use then anytime you want. this is the default workspace location of your projects
named as “NetBeans Projects”. If you changed the location of your workspace before you can access it from there.