HomeDigital EditionSys-Con RadioSearch Java Cd
Advanced Java AWT Book Reviews/Excerpts Client Server Corba Editorials Embedded Java Enterprise Java IDE's Industry Watch Integration Interviews Java Applet Java & Databases Java & Web Services Java Fundamentals Java Native Interface Java Servlets Java Beans J2ME Libraries .NET Object Orientation Observations/IMHO Product Reviews Scalability & Performance Security Server Side Source Code Straight Talking Swing Threads Using Java with others Wireless XML
 

Symantec says that Visual Cafe "gives developers the fastest, most productive visual programming environment ever for creating Java applets and applications." Usually, this would be corporate puffery. Well, in this case, Symantec is actually understating the power of Visual Cafe.

As the Web grows more crowded, you need a way to make your Web site stand out. With Java, you can do this by adding interactivity. Unfortunately, Java is not easy to program. But with Visual Cafe, you will be able to add interactivity with minimal complexity.

Visual Cafe's integrated development environment (IDE) is built for rapid application design (RAD). If you know how to drag and drop, then you should feel comfortable with the IDE. It seems that everything on the screen can be dragged and dropped. In fact, Visual Cafe supports two-way editing. For example, if you type in new code for a Text Field, this will automatically be reflected on the screen. You do not have to recompile the program.

When you start-up the program, you will see the Project window, which includes the applets and HTML files for your project. If you double-click an applet, the Form Designer will appear. This has a true WYSIWYG layout tool. You can drag and drop components from the Component Library and then resize them on the form. Visual Cafe will then automatically generate the necessary code.

Why reinvent the wheel? After all, isn't object-oriented programming meant to cut your programming time by using predefined objects? Well, Symantec understands this quite well, as it has provided a plethora of components to build applets:

  • Standard: These include Horizontal/Vertical Scroll Bars; List; Canvas; Text Field and Area; Choice; Panel; Label; Checkbox; Radio Button, and Button.
  • Additional: This consists of 23 components. Examples include an Image Button, Combo Box, Formatted Text Field, and Status Bar.
  • MultiMedia: This has ten components, such as Moving Animation, Sound
Player and Image View
  • Utility: Here you have a Timer, Calender, Tree View and Progress Bar.
  • Text Fields: These are formatted input fields, such as Zip Code, Phone Number and Social Security Number.
  • Forms: You can create an About Dialog, Open/Save File Dialog, pop-up window message, Password Dialog.
  • Shapes: You have Rectangle, Square, Line, Circle, etc.
  • Panels: You have Tabs, Toolbars, and Radio buttons.
Right-click a component and you go to the Properties List. Here you can change the characteristics of the component, such as the font, background and foreground colors, positioning on the screen, etc. Of course, your changes are automatically updated on the form.

If you want to see the underlying code, you merely double-click the component and the Source Editor will appear. The Source Editor has the necessary features of RAD. Keywords are highlighted in blue; remarks in green; you can use the right mouse button to do Cut/Paste.

OK, so how will it make your programming life easier? Let's see how easy it is to create a Java image map. First, you use the MultiMedia component, called Image Viewer, and draw this on your form to fit the main image. Then you specify the relative URL for this image (which you can do by using your mouse to browse your subdirectories). Next, you want to have one link on the top-left side of the image and another link in the center of the image. You will select InvisibleHTMLLink and then draw these links over the image. Then you will specify the relative URL for these links. That's it. There is absolutely no Java coding.

Likewise, creating animations is just a matter of several clicks. You first click the MultiMedia component called Animator and then position and resize it on your form. Go to the Property List and click URL List. You will use a file dialog to select the files you want in your animation sequence. Done. No coding; Visual Cafe does it for you.

Once you have the necessary components on your forms, you can use the Interaction Wizard to create relationships between these components in a graphical manner. These interactions are the result of an event, such as a mouse click, key event, etc. For example, suppose you have a slide show of pictures. The NEXT and PREVIOUS buttons will cycle through these pictures. Normally, you would need to create Java code to carry out these functions. But not with the Interaction Wizard. Simply click the Interaction Wizard button, then click the PREVIOUS button and drag a line to the Slide Show component. The Interaction Wizard dialog will appear and you will see a list of actions the PREVIOUS button can take. One of these actions is "Go to the Slide Show's next image." Visual Cafe will then create the required code.

As your project gets larger, it becomes difficult to see the overall structure. Visual Cafe helps solve this problem with its Hierarchy Editor and Class Browser. The Hierarchy Editor is a graphical representation of the classes in your project with each class represented by a box and connected to other classes with lines. Of course, you can drag and drop to change the relationships.

If you double-click a class, you will see the Class Browser, which is a window with three panes. The top left pane has a tree of the classes. If you click a class, you will see a list of the methods and data on the top right pane. If you click data or methods, you will see the code on the bottom pane, where you can then edit the code.

When you execute your applet, it will appear in either Sun's Applet Viewer or a browser of your choice. Visual Cafe will list the bugs. You can double click them and the program will take you to the line of code.

The debugger is full-featured. You can set breakpoints. You can stop and resume threads in order to solve sychronization problems. You have a Watch Window, where you can keep track of variables and expressions. There is also a Variables Window which uses a tree view of simple and complex data types.

Java is an interpreted language. That is, a Java class file will consist of bytecodes. The Java virtual machine will then interpret these bytecodes and execute the program's instructions. Unfortunately, this is extremely slow. However, Visual Cafe uses Just-In-Time compilation. The compiler will convert the bytecodes to native code on the fly using a background thread. According to the Symantec Web site, by using JIT, Visual Cafe exceeded the benchmarks of Sun by 19 times and Microsoft J++ 1.4 times.

The online Tutorial is excellent. Step-by-step, you create Java functionality in a Web site for an Internet Travel agency. The typical tutorial of a compiler is something not very useful--such as a spinning ball or scrolling text. Using Visual Cafe's tutorial, you will be able to add cool features to your Web site.

To run Visual Cafe, you need at least 16 MB of RAM (24 is recommended), Win95 or NT 3.51+ and between 20 and 32 MB of hard drive space.

Of course, Visual Cafe will not do everything for you. To create serious projects, you will need to code in Java. However, Visual Cafe streamlines the programming process by allowing you to create common structures quickly and efficiently. You then have more time to devote to important matters.

Many IDE's claim to be RAD but they always seem to fall short. In Visual Cafe, I have finally found a true RAD tool. It makes my job easier--and even fun.

About the Author
Tom Taulli is the CEO of Blueprint Interactive (www.bpia.com), which develops Internet applications for the enterprise. He can be reached at [email protected]

 

All Rights Reserved
Copyright ©  2004 SYS-CON Media, Inc.
  E-mail: [email protected]

Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.