Creating a Windows Application with the Application Wizard
See Also
The Application Wizard automatically generates a Windows application using WFC, and provides the option of binding your form to the fields in a database. You can also specify the packaging options for your project.
Note Before you run the Application Wizard, close any projects that you may already have open. (On the File menu, click Close All.)
To create a Windows application with the Application Wizard
-
On the File menu, click New Project.
-
On the New tab, expand the Visual J++ Projects folder and click Applications. Then select the Application Wizard icon.
-
In the Name box, enter a name for your project.
-
In the Location box, enter the path where you want to save your project, or click Browse to navigate to the folder.
-
Click Open.
-
In the Welcome step, you can choose a profile from the drop-down list. (If the profile you want to use is not listed, click the ellipses button (...) to locate and open that profile.) For more information about profiles, see Introducing Wizards and Builders.
-
Click Next to specify the application type:
-
Select Form Based Application to generate a Windows form-based application.
-
Select Form Based Application with Data to generate a Windows application containing a data-bound form. This option launches the Data Form Wizard to walk you through the process of specifying a database and the fields you want to bind.
-
Click Next to specify the features that you want to add to your form:
-
Menu The wizard adds a pre-defined menu bar.
-
Edit The wizard adds an Edit control that fills the entire client area of the window; the Edit control is used to create a simple "Notepad" application.
-
Toolbar The wizard adds a toolbar with pre-defined buttons.
-
Status Bar The wizard adds a status bar.
-
Click Next to specify the type of source code comments:
-
Javadoc Comment The wizard adds Javadoc comments to all classes and their members. These comments provide useful information about the code that has been generated.
-
TODO Comment The wizard adds TODO comments in sections of the code that can be modified or where code should be added to enhance the application. You can also view TODO comments in the Task List window.
-
Sample Functionality Comment The wizard adds comments for the code it inserts. These comments provide information about what the code is intended to do, and indicate which code was automatically generated by the wizard.
-
Click Next to specify the packaging options:
-
Class files The wizard will not put the project into a package file of any type. Select this option if you want to use a method other than packaging for distributing your application.
-
EXE file When your project is built, an .exe file is created. Select this option if you want to create a single file that can be used to run your application. (This is the default option.)
-
Cabinet (CAB) file When your project is built, a .cab file is created. A .cab file is a compressed file that contains all of the important information for your project. Select this option if you plan to distribute your project through the Internet.
-
Deploy to (URL) You can define a URL to deploy your application to. Specify the URL in the edit box.
-
Click Next to view the summary for your application:
-
To review your settings, click View Report. To save the report, click Save in the View Report dialog box.
-
To save your settings to an existing profile, select the profile from the drop-down list. To save your settings to a new profile, click the ellipses button (...) to specify a file name. (For more information about profiles, see Introducing Wizards and Builders.)
-
Click Finish to create the project. Your application is opened in the Forms Designer.
Building and Running the Application
After you build your application, you can run it from the development environment.
To build and run your application
-
On the Build menu, click Build. Any compilation errors or messages appear in the Task List. (Double-clicking an error in the Task List moves the insertion point in the Text editor to the error.) Correct the errors and rebuild your application.
-
To run the application from the development environment, click Start on the Debug menu.
-
To close the application, click the Windows Close button located in the upper-right corner of the form.
For more information about creating Windows applications, and for a simple example that shows how to modify a form in the Forms Designer, see Creating a Windows Application with WFC.