FIRST GUIDED TOUR

Creating a simple application to introduce the VisualMust basics:

This chapter is organized to give you an overview of VisualMust's functions so you can become productive without delay. By understanding how Visual Must is used conceptually, you will be able to make the most effective use of this tool.

After starting VisualMust, a popup dialog box will be displayed. Select "Create a new design" and click on the OK button. You will be asked the name of this new design, then the type of the design to be created: select "Application" and "JFrame".


 

In the File Name field, type Example1.

Clicking on the frame will cause this frame to be emphasized, allowing you to enlarge or move it.

Selecting an object can be made by clicking the left mouse button.

If you click the mouse button, such as shown in the side picture, you may move or resize components. If you do the same operation (clicking with the Ctrl key), you will be able to duplicate the component. If using the Shift key, you will be able to remove a component from its parent and drop it to the desktop or to another component. This will be very useful when you want to insert a component between two components.


In the toolbar, click on the Container tab, drag and drop the first icon onto the frame : you have inserted a panel within the frame.

In the toolbar, click on the Component tab. Drag and drop the third icon, i.e. the push button, then drop it into the panel you just inserted.

Click on the fifth icon, i.e. Text, just do the same as previously : drop it below the button.

OBJECT PROPERTIES
You may click on the right mouse button and on the popup menu properties. You may change properties, that is, different options of those controls, by clicking on the different available options.

ALIGNMENT

If you want those both controls to be aligned (i.e. button and label), click both button and label with the left mouse button + the Ctrl key. Those controls will be emphasized in pink. With a three-button mouse, you may handle this operation by clicking the mouse button 3, without using the Ctrl key.
Note : each time you will click a pink button, that is a button which is part of a group, this button will be toggled : once it will be part of the group, once it will be removed. If you want this group of controls to be aligned, click both on the right mouse button and the alignment you want.


EVENTS

Events may be set by clicking both the right-mouse button and Events from the popup menu.

This will cause the juxtaposed window to be displayed.

In the frame at the bottom of the list, you will see an event named "WindowClosing".

Select this item and click on the Create button.


A window containing a skeleton of texts about the event to be handled will be displayed.

Replace the "Remove this comment and specialize processing here" with : System.exit (0);

Expert developers may disable the "line protected" option


The Event window will still be displayed : click on the Button item and, on the middle tree view, click on the first action :
actionPerformed
On the right-hand side, click on Create. You have created a action on this button that will be enabled when you click on this button.

Replace the "Remove this comment and specialize processing here" with :

get_JLabel().setText("Hello");

By using the get_JLabel() method, you will get an object named Label and set a "Hello" text.

Note : changing the names of your controls via the properties panel will cause your source code to be modified in accordance with the preferences you set in the Option menu.

You have just created a simple application to be compiled.


Now, without quitting VisualMust, you may compile and test the application you have built by using the Compiler and Run Application menus.