February 25, 2000

Determine if a PDF File Exists From ASP

Question: We have an ASP page that displays product information from a database. We also have a button to download/view a related PDF file that should only appear on the

Stringtokenizer That Works with Empty Strings

import java.util.*;import*;class Class1 { static Vector split(String string,String delimiter) { //StringTokenizer that works with empty strings boolean wasDelimiter=true; String token=null; Vector vector=new Vector(); if(string!=null) for(StringTokenizer stringTokenizer=new StringTokenizer(string,delimiter,true);stringTokenizer.hasMoreTokens();) { if((token=stringTokenizer.nextToken()).equals(delimiter))

Customizing a JComboBox

The JComboBox API provides a programmer with very little directcontrol over how list items are displayed. This is because, in trueobject-oriented fashion, a JComboBox object knows or cares very littleabout

Doing an [import java.package.*]

This tip is probably cosmetic, but it could result in great convenience. Doing a [import java.package.*] would allow usage of [public] classes in theaforementioned package without the usual required verbosity.

How to Format Numeric Values

At times you want to output the numeric values in specific format, for example, you may want to display monetary value with two decimal points, or scientific data with five