Writing Your Own Wrapper Program
Typically, you write your own rendering program if you wish to separate the UI from the application, or when you want to have direct control of the UI components. For example, if you wanted to use a third-party library that required a specific listener, you could add this listener in your wrapper code and update the UI components from the wrapper.
If you decide to write your own wrapper, you must take the following steps:
- Create an AbaRenderer object.
- Execute its Load() method, which returns "true" if the application jar has been loaded.
- Execute the RenderInterface() method in order to render the application:
String jarname = "\\abaguibuilder-1.7\\samples\\person.jar";
m_AbaRenderer = new AbaRenderer(jarname, true , null);
boolean bTestLoad = m_AbaRenderer.load();
Another reason to write your own wrapper is to initialize the visual controls on the form with code in the wrapper program. For example, to load the combo box with items before it is rendered onscreen (as in Listing 2), you can paste the object definitions and the getReferences() function into your wrapper code.
Separating the UI from the business logic is an important topic to consider when designing a visual application. Although beyond the scope of this article, be sure to keep this in mind when using the AbaGUIBuilder.
Delphi and VB Developers, This One's for You
The AbaGUIBuilder has the unique charter of it focusing exclusively on the Delphi and VB developer moving to Java/Swing. As a result, it's not for everyone--it provides the greatest benefit to those application developers seeking an easy front-end development tool similar to VB or Delphi. Abacus Research simplified the IDE with a true WYSIWYG environment, removed complicated layout managers, and hid UI implementation details from the developer.