Class ViewFrame

All Implemented Interfaces:
WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class ViewFrame extends JFrame implements WindowListener
Convenience window (JFrame) that creates and hosts a ViewPanel for 3D rendering.

This is the simplest way to get a 3D view up and running. The frame starts maximized, enforces a minimum size of 400x400, and handles window lifecycle events (minimizing, restoring, closing) automatically.

Quick start:


 // Create a window with a 3D view
 ViewFrame frame = new ViewFrame();

 // Access the view panel to add shapes and configure the scene
 ViewPanel viewPanel = frame.getViewPanel();
 viewPanel.getRootShapeCollection().addShape(
     new WireframeCube(new Point3D(0, 0, 200), 50,
         new LineAppearance(5, Color.GREEN))
 );

 // To close programmatically:
 frame.exit();
 
See Also: