Creating a new custom Java class template option in BlueJ

So, I'm in this CS1410 class and we write a lot of simple Java apps, but we always have to have a certain structure to them when handing them in. Well, by default, the "New Class" template had a lot of extra crap so I went in and figured out how to create a new custom class option. Here are the steps I took:

Apple OS X

  1. Navigate to your BlueJ.app
  2. ctrl+click on it and choose "Show Package Contents" from the contextual menu.
  3. Navigate to "Contents/Resources/Java/english/templates/newclass".
  4. Duplicate the file "stdclass.tmpl" and name it "customclass.tmpl".
  5. Open this file with a text editor and put in what you want to show up in your new custom class. Note that the variable "$CLASSNAME" will dynamically put in the name of the new class that you type in the dialog box so you may want to keep that in when declaring your class.
  6. Now, go up two directories to the "english" directory and look for a file called "labels". Open this with a text editor and look for the line "pkgmgr.newClass.stdclass=Class". Create a new line after this line and type the following "pkgmgr.newClass.customclass=Custom Class".
  7. Save your files, close them up and restart BlueJ. You will notice that when you go to create a new class you will have the option to check "Custom Class" now. Enjoy. :]

Windows XP

  1. Navigate to where you installed BlueJ (in my case it was C:\BlueJ)
  2. go into lib\english\templates\newclass
  3. Duplicate the file "stdclass.tmpl" and name it "customclass.tmpl".
  4. Open this file with a text editor and put in what you want to show up in your new custom class. Note that the variable "$CLASSNAME" will dynamically put in the name of the new class that you type in the dialog box so you may want to keep that in when declaring your class.
  5. Now, go up two directories to the "english" directory and look for a file called "labels". Open this with a text editor and look for the line "pkgmgr.newClass.stdclass=Class". Create a new line after this line and type the following "pkgmgr.newClass.customclass=Custom Class".
  6. Save your files, close them up and restart BlueJ. You will notice that when you go to create a new class you will have the option to check "Custom Class" now. Enjoy. :]

Hopefully this helps some other students. :]