This method shown in Figure 11 places the frame in the centre of the screen, and can be
used in conjunction with the MainFrame utility class. The line, which uses ViewManager
to place the frame in the centre of the screen, is taken from the main method in View-
ModelApp. The object frame is an instance of MainFrame that holds the viewModel, an
instance of ViewModel.
GettInG confIGuratIon for canvas3d
Figure 12 illustrates the method that can be used to return the GraphicsConfiguration that
can be used for Canvas3D. Note that a warning will be given if Canvas3D is instantiated
using null for its GraphicsConfiguration.
Figure 11. palceInScreenCenter method
Figure 12. GraphicsConfiguration
GraphicsConfiguration config = viewManager.getPreferredGraphicsConfiguration();
Canvas3D canvas3D = new Canvas3D(config);
Search WWH ::