Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. If you have not already done so, create a Java Project (File -> New -> Java Project). TODO: Add naming guidelines.
  2. Add the GFW and SwingUtil to your Eclipse project buildpath. You can do this either by including the GUIFramework project from and SwingUtil projects to your workspace, and then Importing them into your new project, or by including their jar files from the production distribution location. E.g. GUIFramework.jar from its production location is in /usr/local/lcls/physics/GUIFramework/jar/GUIFramework.jar.
  3. Instantiate the custom components. For instance, if you have not yet created the main class, now you would do so. Note, that this class is likely to be in a different package to the User Interface package if you are separating UI components from application code.
  4. Create a BasicFrame or a ModelFrame instance of the GFW, e.g
    Code Block
    final BasicFrame myFrame = new BasicFrame("My Frame"); 
    
    or
    Code Block
    final ModelFrame myFrame = new ModelFrame("My Model Frame"); 
    
  5. Add custom components to various areas of the GFW frame, such as
    • Title Bar
      Code Block
      myFrame.addToTitleBar(myComponent);
      
    • Tab 1
      Code Block
      myFrame.addTopTab1(myComponent);
      
    • Tab 2
      Code Block
      myFrame.addTopTab2(myComponent);
      
    • New Tab
      Code Block
      myFrame.addTopTab(myComponent, "My Label");
      
    • Bottom ScrollPane
      Code Block
      myFrame.addToBottomScrollPane(myComponent);
      
  6. Set application version
    Code Block
    BasicFrame myFrame = ...; // see above
    JLabel appVersionLabel = myFrame.getBasicPanel().getStatusPanel().getAppVersionLabel();
    appVersionLabel.setText("my version"); //run in the GUI thread, of before displaying the frame
    
  7. #Add event listeners to the appropriate widgets
  8. Display the GFW frame
    Code Block
    SwingUtilities.invokeLater(new Runnable() {
    	public void run() {
    		myFrame.setVisible(true);
    	}
    });
    

...