Java Utils
LineEndConvert
Convert the line endings of a text file to the OS platform desired. This program converts to and from Mac (\r), Unix (\n) and DOS (\r\n) line endings. This program can also replace all line endings with the HTML
tag. Download 
URLGetFile
Have you always wanted to download content served by a HTTP link, but are unable to because your browser won�t let you? Mostly this is because the content is served by CGIs and when you click on “Save As” and save it, it’s not what you want. How about sites that serve special content that you can�t download through the browser (such as asf movies).Get my URLGetFile program to download the content referenced by a ftp or http URL 
ChangeFileExtension
Ever wanted to batch change the extensions of files, say from *.jpeg to *.jpg? Use my program below to do that easily.
Get my ChangeFileExtension program. (or you could just use the ‘rename’ function in WinNT, i.e. ‘rename *.jpg *.jpeg’ ) 
IPChangeNotifier
Do you have a high-speed ADSL or cable modem connection, and have a dynamic IP address? If so, and you have servers running on your computer, you might need this handy utility. This utility will send the IP number of the local machine it is running on to an e-mail recipient, and will continually check the IP address (at an interval you define) to see if it is changed, and it will send off that e-mail if the IP changes (in the case where your IP lease is renewed). Note that SendMail.java (public domain) was not written by me, but from Rajiv Betul at rajiv.com. (why reinvent the wheel?) Download IPChangeNotifier 
DomainNameChecker
This handy class checks whether a domain name is legal based on the RFC 1738 spec. The primary use of this class is for validation of server names in dialogs and such. View the code here. (this doesn�t view properly in the IE browser, save it to disk and view it with a text editor) 
EmailNameChecker
This class will verify that an e-mail address is of the proper format. The verification is based on the RFC 822 spec (I did not implement it fully in this version). The primary use of this class is for validation of e-mail addresses. It needs DomainNameChecker (above) to work. View the code here 
FileManager
This class handles file management functions such as copying, moving, deleting of files and directories. It also handles writing Strings/String arrays to file (in overwrite or append mode, for example for use in log files). View the code here 
Matrix
Here are 2 classes that deal with Matrix algebra, Matrix.java
and Matrix3D.java
Matrix has functions for identity, scaling, negating, adding, equality, dot product (of vectors), and retrieving a column or row of a Matrix as a vector. Matrix3D represents a vector in 3D space, and it has functions to rotate, translate, scale, reflect and shear the 3D point, as well as functions for cross product, and angle between two vectors.
JavaZip (uses Swing)
With apologies to WinZip (for ripping the look and feel, and also the images for the buttons), this is a �lite� version of the Win32 Winzip to Java. Of course not all the features of Winzip are replicated in JavaZip, because of some Swing limitations (like no multiple selection implementation in a FileChooser in any of the Look&Feels) and time constraints. Download it here. (Note: this is a mainly a ‘demo’ project, and has only been lightly tested, so there will definitely be some errors. The GIF images in the downloadable files are copyright WinZip). Download 
JEditableLabel
This Swing UI component is a simulates a JLabel that can be �edited� by clicking on the text label. It really is a JTextField in disguise as a JLabel. What are its uses? I�m sure someone can figure that out
(for example, a label of a file in a tree view where you click on it to edit a filename) View the code here 
IntSpinControl
Spinner type control for incrementing/decrementing integer values in a textfield. IntSpinControl.java
ArrowButton.java 
Note: With the new JDK 1.4 there is a javax.swing.JSpinner class available with similar functionality.
StringSpinControl
Spinner type control for traversing string values in a textfield. StringSpinControl.java
ArrowButton.java 
Note: With the new JDK 1.4 there is a javax.swing.JSpinner class available with similar functionality.
Cubic2Quadratic
(uses the java.awt.geom.* package)
Cubic Bezier approximation using (possibly) multiple Quadratic Bezier curves.
Approximates a cubic curve by converting the cubic curve into multiple quadratic curve segments. If the points on a (sub-divided) cubic curve are co-linear, a line segment is drawn instead.
The code was ported from the SWF Ming library code, version 0.2a, �shape_cubic.c� (http://www.opaque.net/ming/)
Note:
In the code I am using a com.anotherbigidea.flash.movie.Shape object from the JavaSWF library. Pay particular attention to the two functions Shape.line and Shape.curve that you have to substitute for the shape objects that you will be using.
Parameters:
line(x,y) where a line is drawn from the current pen position of the shape to the point at (x,y)
curve(x2,y2,ctrlX,ctrlY) where a quadratic Bezier curve is drawn from the current pen position of the shape to the end point at (x2,y2) with the control point at (ctrlX,ctrlY)
Alternate Cubic2Quadratic algorithm:
There is another way to approximate a cubic Bezier using line segments (instead of quads). This of course involves more drawing commands, but here is the algorithm:
First, two definitions:
- A cubic Bezier curve is defined by 4 points: a start point(p1), two control points (ctrl_p1 and ctrl_p2) and the end point(p2).
- The flatness of a cubic Bezier curve is defined as the max distance of the 2 control points from a line segment drawn from p1 to p2
Algorithm:
IF the flatness of a cubic curve is less than or equal to a certain tolerance (for example 1e-3), draw a line from p1 to p2
ELSE subdivide the cubic curve (at t=0.5) and recurse.