Java tips and programs

Here's a collection of java programs I have for folks to look at. They are all free to use.

Bolthole java software
Jcrossclient A java front end to Crossfire, the multi-user game
Jdrill A java program to help study Japanese Kanji
utfconvert A java program to convert charset encodings (eg: UTF->EUC)
Xpm.java An .xpm format reader for java
UserPrefs.java java class for loading user preferences in an application. Docs here
Listor A free table-like class, to list data in rows (source code). AWT based. Allows user to resize column widths.
FscrollPane.java A free substitute for java.awt.ScrollPane
FscrollTable demo Better yet, an AWT table class! (rather bare bones, binary only)
About.java A trivial "About" box that can also be used to pop up any text file
jmail.java A trivial "send SMTP" prog that uses java's "Mailto" URL handling to send email. Works with any JVM since java 1.0, I think.
flexilayout A work-in-progress to give a very flexible layout widget. Allows you relative positioning to two other objects, for independant up/down, and x/y control. Does for FlowLayout what GridBagLayout does for GridLayout: Surpasses it in the extreme. Click through for the flexilayout home page.
jdbentry A GUI utility to let you or a user add rows by hand to a table in a local database. Currently geared for use with MySQL, but should be easy to modify for use with Sybase, Oracle, etc.
jhtmlindex A small java prog that takes a HTML page as STDIN, and spits out a simple table of contents, using OL tags.
  
javascript+pureHTML
co-existence
Okay, this is NOT JAVA! But I needed somewhere to link this from, so here it is.
This page demonstrates some methods for how to make a page that works great with both javascript-enabled browsers, AND plain non-javascript-enabled browsers.

Javasoft resources

For some free applets from SUN, take a look at http://java.sun.com/applets/

Better yet, for detailed examples of typical programming tasks, read the Javasoft Java Tutorial. It isn't always obvious, but if you dig in there enough, you can find the "best" way to do most things with java.


General tips on how to use java as a user

First, you have to GET a java runtime! I recommend getting one from javasoft, the people who control Java.

Currently, the more stable one is one based on the 1.2 spec. Try downloading the 1.2 standard runtime This allows things like direct running of .jar files.

The latest version is 1.3; however, currently, 1.2 is probably the most bugfree. (July 2001)


Using 'optional' classes

A lot of folks think that they have to choose either the latest java runtime + features, OR the old runtime, when targetting what java platform to write for. Sometimes, however, you can do both!

If you are taking advantage of a new java class in later runtimes, that simply is not present in older runtimes, you can choose to enable or disable features depending on whether the new class is accessible.

Download and compile parent.java and aux.java, two simple classes. Run 'parent' to see it use the 'aux' class. Then remove the 'aux.class' compiled class, and run 'parent' again. It will run differently, because it detects that the aux class is not available.


If you want to run Japanese-displaying java software

(or if you want to display other than ASCII characters) you *MUST* get a version that has the full "internationalization" support. Be careful what you download. When you get to the final "Download Java Runtime x.x" screen, with an ftp and http link: SCROLL DOWN!!

Generally, if it isn't more then 10 megabytes, it probably doesn't have the extra support.

Now you have to do some annoying extra setup. Go to my Unicode setup pages, then come back here to finish up.


Using a java runtime

Okay, you have the runtime... now you want to run a program! For the older stuff, your setup is somewhat longer, for every program you want to run.

Read the java 1.1 details


If you have a newer java 1.2-based runtime, you should be able to run most, if not all, of my programs "directly". That is to say, with a single click in a GUI environment. Some platforms require a little more setup than others, but once you are done, you should be able to run the ".jar" file just like it was any other program.

Read the java 1.2 details on how to set up one-click operation.


If you have any suggestions, comments, or "hey, it works on platform xxx, cool", drop me a line!
phil@bolthole.com

Bolthole.com