Thursday, August 01, 2013

How to change a file extension in NetBeans

My friend Bruno Borges has asked NetBeans team to fix an issue about supporting extension changes in files during renaming. Looking about it I have found that NetBeans already support extension changes, not during renaming but it can be achieved using Properties view. I agree that it is a little bit hidden, so the idea here is write some words about it and make the user's life a little bit easier.

Basically what you need to do to achieve this is open Properties view in Window > Properties menu or using the shortcut Ctrl + Shift + 7. After that, select your file directly in Projects, Files, Favorites or even by opening it in the editor. Now, if you select a XML file for example, your Properties view should be something similar as the image below.


Now you can change the Extension property and the file type will be change as expected. I hope this little tip can help you.

Happy coding!