FileDocCategorySizeDatePackage
StringAlignDemo.javaAPI DocExample1095Mon Feb 26 12:21:00 GMT 2001None

StringAlignDemo

public class StringAlignDemo extends Object

Fields Summary
Constructors Summary
Methods Summary
private static voiddump(int format, int len, java.lang.String s)

		System.out.print((char)format + "[" + len + "]");
		System.out.print(" ==> \"");
		System.out.print(s);
		System.out.print('"");
		System.out.println();
	
public static voidmain(java.lang.String[] argv)
Demonstrate and test StringAlign class

		String[] mesg = {"JavaFun", "JavaFun!" };
		for (int i=0; i<mesg.length; i++) {
			System.out.println("Input String \"" + mesg[i] + "\"");
			dump(StringAlign.JUST_LEFT, 5,
				new StringAlign(5, StringAlign.JUST_LEFT).format(mesg[i]));
			dump(StringAlign.JUST_LEFT, 10,
				new StringAlign(10, StringAlign.JUST_LEFT).format(mesg[i]));
			dump(StringAlign.JUST_CENTER, 5,
				new StringAlign(5, StringAlign.JUST_CENTER).format(mesg[i]));
			dump(StringAlign.JUST_CENTER, 10,
				new StringAlign(10, StringAlign.JUST_CENTER).format(mesg[i]));
			dump(StringAlign.JUST_RIGHT, 5,
				new StringAlign(5, StringAlign.JUST_RIGHT).format(mesg[i]));
			dump(StringAlign.JUST_RIGHT, 10,
				new StringAlign(10, StringAlign.JUST_RIGHT).format(mesg[i]));
		}