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.
- Before
setting up TextPad, download and install the current Java SDK from
SUN. Then TextPad
will configure itself to use that Java SDK.
- Go
to http://www.textpad.com on your
browser and download as instructed.
- 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.
- To
run TextPad, click on the icon in the Start menu, under Programs.
- 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.
- 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.
- I
use the default settings for colors, but you can change them if you want.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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