Quick Start: Setting the First Screen
Overview
- Use the Application section of the Project Overview to open the source code for your main application class.
- Switch to the Source Context in the EchoStudio Form Editor.
- Update the init() method to set the contents of the mainWindow instance variable to a new instance of the form component you want loaded as the first screen.
- Use the Launching section of the Project Overview to launch your application.
- When you are done playing with your application, click the Terminate button in the action bar.
Video
View the short video walkthrough (414k, 0:37) to observe the techniques described in this section.
Details
Use the EchoStudio Project Overview to open the source code for the main application class. (Figure 1) The main application class will open in a Java source code editor. (Figure 2) Find the init() method. It should read:
mainWindow = new Window();
//TODO: Set content of main window:
ContentPane contentPane = new ContentPane();
contentPane.add(new Label("(Default main window content)"));
mainWindow.setContent(contentPane);
return mainWindow;
Update the init() method to set the contents of the mainWindow to a new instance of your LoginScreen form component, as shown:
mainWindow = new Window();
mainWindow.setContent(new LoginScreen());
return mainWindow;
Save your changes. Return to the Project Overview, find the Launching section, and click Launch the Application. (Figure 3) A browser will open to present your application. The application should display your login screen.
After you have played with your application a bit, close the browser window and return to the Project Overview. Click the Terminate Application button in the toolbar. (Figure 4)
|