A Sample Walkthrough

This section contains a brief overview of a simple Visual J++ application called MyNotepad, which is based on the Windows Notepad application. MyNotepad is a Text editor with a File menu containing New, Open, Save, Save As, and Exit menu items. It covers the most primitive functions of an editor, allowing the user to open a file, edit it, and save it to the same file or to a different file.

Note that this application is similar to the JPad application generated using the Visual J++ Application Wizard. However, MyNotepad was not constructed using the Application Wizard; it was written specifically to demonstrate a few basic concepts as clearly as possible. After walking through MyNotepad, the code generated by the Application wizard should be much easier to understand, since it uses most of the same principles.

MyNotepad is essentially a single form (MyNotepad.java) with an edit control and a menu. A second form (NewDialog.java) represents the modal dialog box that prompts the user to save when opening a new file or closing the current file. You can find a complete listing of the code for both these files at the end of this topic.

This application was designed and coded using the Visual J++ Forms Designer and Text editor. Much of the code was automatically generated by the designer. This walkthrough points out what the Forms Designer does for you, the code automatically generated by the designer to create this application, and a few basic concepts for programming a WFC application. Specifically, it describes:

The Sample Walkthrough ends with: