Ok, I found an old P2 350MHz that has an integrated video card with no OpenGL support! I tried loading the OpenGL version of my class that used the AWTGLCanvas and it loaded without an error, but it puked on the first paint! So I went back to using the Pbuffer. What happened there was that when it tried to create the Pbuffer it would throw and exception so I just caught that and used that to decide to load the Java2D version. Here is my code for that part:
try
{
System.out.println("Trying OpenGL");
try
{
Pbuffer buff = new Pbuffer(1, 1, new PixelFormat(), null, null);
if (classLoader == null)
{
theClass = Class.forName(openGL);
}
else
{
theClass = classLoader.loadClass(openGL);
}
System.out.println("OpenGL Succeeded");
buff.destroy();
}
catch(ExceptionInInitializerError eiie)
{
System.out.println("OpenGL Failed\nTrying Java2D");
if (classLoader == null)
{
theClass = Class.forName(java2D);
}
else
{
theClass = classLoader.loadClass(java2D);
}
System.out.println("Java2D Succeeded");
}
}
catch (ClassNotFoundException cnfe)
{
throw cnfe;
}