FileDocCategorySizeDatePackage
TestForSwing.javaAPI DocExample640Tue Mar 13 10:18:18 GMT 2001None

TestForSwing

public class TestForSwing extends Object
Test for presence of Swing on classpath at runtime.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		try {
			Class.forName("javax.swing.JButton");
		} catch (ClassNotFoundException e) {
			String failure = 
				"Sorry, but this version of MyApp needs \n" +
				"a Java Runtime with JFC/Swing components\n" +
				"having the final names (javax.swing.*)";
			System.err.println(failure);
			// Make something appear in the GUI. Either a JOptionPane, or:
			// myPanel.add(new Label(failure));
			throw new IllegalArgumentException(failure);
		}
		// No need to print anything here - the GUI should work...