The progress information is made available using two different classes: SwingProgressPanel is used to display the progress in the GUI, and SwingDemoProgressContext is used to handle the communication between COMSOL Multiphysics and the areas the application that needs information about progress.SwingDemoProgressContext extends SwingProgressContext, which is described in the reference section at the end of this chapter.
1 Use the mouse to drag and drop these files to the src folder shown in the Package Explorer in Eclipse: SwingDemoProgressContext.java and SwingProgressPanel.java.
2 Open the BeamModelDemo.java file and navigate to the start method.
3 Add these lines before the call to frame.visible
4 These lines are added to the progress panel to the bottom of the main window and the context is set up between COMSOL and the user application.
7 Run the application by right-clicking BeamModelDemo.java in the Package Explorer and select Run as>Java Application.