I am creating an applet to embed in an HTML page. This applet uses the GroupLayout class, which is found in Java SE 6, but not in 5.
When someone whose computer runs Java 5 or earlier opens this HTML page, what would happen?
Would the applet not run properly?
It will throw ClassDefNotFoundError. To avoid this do not use new API or use third party API or “still” group layout: take the class, change its package, include into your project and use it. You can even do it better. Create instance dynamically using Class.forName(). If it succeeds use the standard implementation, otherwise use your stolen class. You can do it because typically you can use standard LayoutManager’s API without using API of specific class loader.