TextPad: set up and use (Windows)

TextPad is an editor for Windows with menu selections to compile and run Java code.  TextPad is shareware, so if you like it after testing, you should buy a license.  It is quite reasonable, with discounts for volume (about $21 for one license, down to $10-15 each for multiple licenses).  See the website for details.

  1. Before setting up TextPad, download and install the current Java SDK from SUN.  Then TextPad will configure itself to use that Java SDK.
  1. Go to http://www.textpad.com on your browser and download as instructed.
  1. Run the txpeng450.exe file to install.  Using the default settings for directories is simplest.  The file name may differ a bit as they upgrade the software – this one is for TextPad 4.5.
  1. To run TextPad, click on the icon in the Start menu, under Programs.
  2. Configure TextPad to your own preferences by selecting Preferences from the Configure menu.  Open the Document Classes and under that Open Java.  Then you can set editor preferences that will be in effect when you are editing a .java file.
    1. I always set tabs to convert new and existing tabs to spaces.  That way the code looks OK when you open it in another editor or send it to a printer with different tabs set.  I prefer two space tabs and set that.  You may prefer three or four, so set it up for yourself.
    2. I use the default settings for colors, but you can change them if you want.
    3. I usually use the default for fonts as well, but I sometimes change it to a larger bolder font when I am projecting code for a class setting.
  1. Type in your code and save as a .java file.  Remember, the file should have the same name as the class.  You can also load and edit an existing .java file.
  2. To compile a class, click on Tools, Compile Java.  It will also compile any classes that this one depends on that are not yet compiled.
  3. To run an application, select the file containing the static void main method and click on Tools, Run Java Application.  You can also run an applet with Run Java Applet.
  1. You can do other commands using Tools, Run.  For example, with the DOS command set, I use this to run javadoc to create JavaDoc style documentation.  I also can run jar from here to work with or create jar files.  These are both tools that come with the Java SDK, but you do not need them for doing simple Java work.
  1. If you use library files other than the standard files that come with the SDK, such as ones that come with a textbook or ones that you have developed or gotten from a third party, you will need to set things up to use them. These files are usually stored as *.jar files (Java Archive). One way to make your jar files accessible to the TextPad environment is to place them in the correct directory as described here. The other way os to set up a environment variable CLASSPATH.

 

Chris Nevison
chris@cs.colgate.edu
June 2002