About Bluestone  |  Contact Us
 
 
text begins here text ends

Unix-based Tools

Java-based Tools

 

IT Staff Augmentation

  • Development
  • Database
  • System Admin.
Training
 
 
 
 
 

 

JClass and Swing White Paper

Executive Summary

This paper discusses the added value JClass GUI components from Sitraka bring to Java and Swing developers. While Swing offers basic graphical user interface (GUI) functionality, several important higher-level features such as sophisticated charting and graphing, data-intensive tables and database connectivity are missing. JClass uses Swing as a foundation but offers a wide range of advanced GUI capabilities to complement and enhance the basic Swing toolkit. These features are difficult and costly to build in-house, making JClass a cost-effective solution for developing enterprise-class GUI applications.

Introduction

With advances in technology touted as the key to competitive advantage, businesses are expecting more and more from applications built for enterprise environments. And with the building of more complex applications, the importance of the interface grows. Without a flexible, intuitive and scalable means of visualizing and interacting with complex functionality and data, the user is unable to realize the application's full potential, and the business is likewise prevented from reaping the desired results. Whether the goal is to streamline a supply chain, optimize a customer service system, or monitor financial portfolios, businesses want speed, efficiency and ease of use from their applications. Development teams seeking to meet these demands must focus on the scalability, performance and scope of their GUIs. Building effective GUIs for this demanding set of criteria requires tools that offer both quality and long-term cost-effectiveness.

Sun Microsystems recently broke new ground in this regard with the introduction of Swing. This paper addresses:

  • The history of Swing and AWT
  • Swing's current status in GUI development for applications
  • The value that JClass JavaBeans and components from Sitraka add to Swing
The paper demonstrates that Swing alone, while it introduces major advances over AWT, is still an incomplete solution for professional GUI development. Furthermore, the paper explains the following benefits offered by the JClass family:

  • Rather than serving as an alternative to Swing, JClass uses the Swing toolkit as a foundation and then significantly extends and enhances Swing functionality.
  • JClass allows developers to build high-performance, scalable GUIs not attainable with Swing alone.
  • JClass provides data connectivity for data-intensive enterprise-class GUI applications.
  • JClass components are reusable, providing long-term cost-effectiveness.
  • GUI development is faster and more efficient with JClass, which significantly increases developer productivity.
AWT and the new Swing era

When Sun Microsystems announced the release of JDK 1.2 with Swing, the news appeared to herald a new era in GUI development for Java applications Swing, a set of GUI components designed to extend the Abstract Windowing Toolkit (AWT), took its place in the core Java Development Kit (JDK) and is now included with the new Java 2.

Swing is part of Sun's Java Foundation Classes (JFC), a group of features that help developers build GUIs for applications written in the Java language. Swing itself is essentially a collection of useful items that act as interface building blocks such as buttons, menu bars, dialog boxes, split panes, scroll bars and tables. JFC also offers 2D rendering, an accessibility API, and drag-and-drop functionality. These Swing components are part of the broader developer's toolkit that comprises the JDK. Developers typically use the JDK and its subset, Swing, within an Integrated Development Environment (IDE) such as IBM Visual Age for Java, Inprise JBuilder or Symantec Visual Café. There is no doubt that Swing has made an impact in this space, having ushered in an array of impressive new features and functionality for the GUI developer.

Most importantly, Swing offers critical advances over AWT. First, Swing's lightweight component design does away with the need for platform-specific implementations (commonly termed peers) that earlier heavyweight components demanded. No peers means less pressure on system resources and consequently more efficient applications that perform better.

Second, Swing's new pluggable look-and-feel (PLAF) capabilities allow the developer to easily customize a cross-platform look-and-feel that maintain its integrity regardless of the system it's running on. Alternatively, the developer can take advantage of pre-set look-and-feel styles that target Windows 95, 98 or NT, Motif or Macintosh. (There is an additional "Metal" look and feel that is suitable for any platform.) What's more, Swing can detect the user's native platform and call the appropriate look automatically without any special programming on the developer's part.

Third, Swing provides a much broader tool set than AWT. One of AWT's biggest drawbacks was that it lacked sophisticated GUI components such as a tree/outliner, a tab manager, a grid/table and common dialogs that GUI developers need. These components have finally been delivered as part of the Swing toolkit.

Migration to Swing

Sun Microsystems, not surprisingly, is confident that Swing will redefine the way in which Java developers build their GUIs. A Sun article introducing Swing, for example, predicts a bright future:

"Swing components are so much more powerful and elegant than their AWT counterparts that just about all Java-language developers are now migrating to Swing."

Swing's limitations

This picture of rapid Swing adoption leans toward the rosy side of the spectrum. Nonetheless, it's probably safe to say that migration is occurring at a fairly healthy rate, and that Swing does indeed make Java GUI development a much less onerous task than in the past. But is Swing a panacea? Far from it. While Swing constitutes a next-generation GUI toolkit relative to AWT, and could be said to render certain GUI add-on packs obsolete (such as JClass BWT, RogueWave Blend.J and JScape WidgetsPro), it nevertheless won't answer all the needs of serious GUI developers.

Many developers look to Swing for a complete GUI solution, only to discover that there is still a clear need for the component add-on packs available from third-party vendors. Swing itself, while it covers many of the basics and serves as a sound foundation, offers little more than bare-bones functionality in a number of important areas. What's more, many necessary components are missing altogether. For example, Swing includes a Color Chooser component, but not a Font Chooser, and its tabling capabilities are embryonic at best. As for more sophisticated features such as charting and graphing, or data entry and validation fields, developers will search in vain: Swing provides nothing in these areas. Consequently, especially for developers working on enterprise-class applications, Swing alone has proven to be an incomplete solution.

JClass Commercial off-the-shelf components

Third-party GUI components are nothing new. Typically, these components are designed for maximum reusability, offering the purchaser the benefit of long-term cost-effectiveness. Components built in-house to meet a requirement of a specific application tend to be used only once. When the next project comes along, the need for more components often accompanies it. Building these customized components can be time consuming and very costly given their short life span. Commercial off-the-shelf (COTS) components can help development teams avoid these costly efforts, but only if these components have feature sets rich enough to meet a wide range of development needs, as well as a reliability and support record that teams can depend on.

In the Java development space, COTS components are typically built to meet Sun Microsystems' JavaBeans standard, which ensures a measure of consistency and a baseline of quality. The advent of Swing, however, seems to be exerting an influence on the nature and sophistication of these COTS component packages. High value and maximum flexibility must be offered if the package is to survive. COTS component vendors must respond to a third-party product by offering enhanced feature sets that fulfill the needs of evolving development environments. And many packages won't make it through this Swing-inspired survival of the fittest. One company that continues to flourish in this redefined space is Sitraka), maker of the JClass family of 100% Pure Java GUI components.

Sitraka: Components veteran leads the field

With a decade of experience behind them, Sitraka is no stranger to the components space. In fact, long before Java's grand entrance on the development scene, Sitraka was building COTS components for the Unix/Motif market with their XRT product line of Motif widgets, as well as components for the Windows ActiveX market. Sitraka, quickly recognizing the coming Java revolution, became the first commercial vendor of Java components with the release of JClass LiveTable in 1996. JClass BWT then became the first component to receive Sun's 100% Pure Java certification, a program developed in coordination with Sitraka. Soon earning a solid reputation among early adopters of Java, Sitraka continued to expand and upgrade the JClass line, and to provide timely support for the evolving JDKs (1.0.2 through to 1.2) and AWT through Swing. JClass Version 4.0, released in June 1999, marked another milestone, as JClass became the first JavaBeans collection to provide optimized support for Java 2.

Swing and JClass: Not an either/or proposition

Swing and JClass are not alternatives to one another; nor are they competitors. They are complementary. JClass is a collection of high-performance components that significantly augment what developers could achieve with Swing alone.

JClass builds upon the Swing foundation to provide a generous range of advanced GUI capabilities such as 2D charting, sophisticated table functionality, and other higher level features essential to professional developers working on large-scale and data-intensive business applications.

The most recent release of JClass (version 4.0) includes the following products, available individually or in Standard or Enterprise Suite packages:

JClass LiveTable Powerful grid/table component for building sophisticated data-driven tables
JClass Chart 2D charting component, with multiple business and scientific chart types including bar, pie, area, line, plot, stacking, candle, HiLo and more
JClass Field A collection of data-aware JavaBeans for providing data input and validation for a range of popular data types
JClass HiGrid Unique grid for managing and displaying dynamic, hierarchical data – lets developers build data-bound GUIs in minutes
JClass DataSource Hierarchical data source that binds automatically with any JDBC or in-memory data object. Works with JClass HiGrid, JClass LiveTable, JClass Chart and JClass Field
JClass PageLayout Powerful component that embeds professional printing capabilities into Java applications and provides complete control over page layout
JClass SwingSuite Comprehensive collection of enhancements and extensions to the basic Swing components
JClass JarMaster Java archiving utility that significantly reduces download times by optimizing JARs before deployment

Swing/JClass feature comparison

JClass products not only enrich the range of functionality available to the Swing GUI developer, they also help the developer to build applications with superior performance and scalability. What's more, the components are built to maximize visual ease of use, and to integrate with visual development environments.

Charting

No equivalent of JClass Chart is available from Swing. JClass Chart offers a wide variety of 2D chart and graph types including bar, pie, area, stacking, HiLo, scatter plot, line, candle and more. For financial, scientific and other business applications that require sophisticated, interactive displays of data, these capabilities are highly useful.

Moreover, attempting to create specialized charting of this nature in-house would be an untenably costly and laborious task. In this instance, JClass fills in a gap in the overall Swing toolkit for which a manual alternative essentially does not exist.

Grid/Table functionality

JClass LiveTable is a flexible table/grid control for tabular data that significantly surpasses the functionality offered by JTable, its Swing equivalent. JClass LiveTable's JCTable can dynamically display data from any external data source and offers numerous features unavailable in JTable, including spanning cells, frozen rows and columns, improved performance and built-in data binding. What's more, JClass LiveTable scales to the most demanding environments.

Swing's JTable lacks JClass LiveTable's sophisticated functionality such as the Custom Cell property setting below:

Swing JTable vs. JClass LiveTable feature comparison:
Feature Swing JTable JClass
LiveTable
Customizable renderers x x
Customizable editors x x
MVC-style data source x x
Cell spanning   x
Built-in column sorting   x
Draggable rows & columns x x
Extensive event notifications   x
Word wrap   x
Databound in IDEs   x
Advanced Bean Editors   x

Swing Extensions

JClass SwingSuite, introduced to the JClass family shortly after the release of Swing, was designed specifically to enhance individual javax.swing components. SwingSuite consists of a collection of JavaBeans, components, layout managers and handy utilities that augment the standard Swing components or provide additional components missing from Swing. For example, Swing provides checkboxes and radio buttons, but no spin boxes. In JClass SwingSuite, however, the JCSpinBox fills the need for components that allow the user to select a number or a String by clicking up or down arrows.

The following table lists some JClass SwingSuite objects along with their nearest Swing relatives. The accompanying description details the advantages gained by using the JClass SwingSuite component:

Swing JClass SwingSuite JClass Value-add
JEditorPane
A text component for content editing
JCHTML Pane Its constructor takes either an HTML string or a URL, making it easy to add HTML pages to a pane. It follows hyperlinks without having to add listeners explicitly.
JPane
A container used to create an MDI or virtual desktop
JCMDIPane A pane that can hold multiple document interface (MDI) frames
JInternalFrame
Object that provides many of the features of a native frame, including dragging, closing, menu bar support and so on
JCMDIFrame Supports the multiple document interface paradigm with the automatic addition of a "Windows" menu to the parent menu bar
JFrame
Extended version of java.awt.Frame
JCExitFrame Automatically responds to window closing events
JTree
JTable

Table and tree formatting components
JCTreeTable
JCTreeExplorer
Components that combine tree and table views of hierarchically ordered data
(AWT) GridLayout
Grid layout component
JCAlignLayout An easy way to lay out a two-column grid
JComboBox
Combination of a text field and drop-down list
JCSpinBox
JCSpinNumberBox
These spin boxes are the top half of a combo box. They are useful when you don't need a drop-down list.
No Swing equivalent JCFontChooser
JCFontChooserBar
JCFontChooserPane
Choose fonts from a menu or a dialog
No Swing equivalent JCElasticLayout For laying out components in a single row or a single column. Any leftover space in the component is divided among the components you specify.
No Swing equivalent JCWordWrap Wraps lines, given a length and a new line delimiter.
No Swing equivalent JCProgressHelper A thread-safe class that reports the status of a time-consuming operation.
No Swing equivalent JCMultiSelectList Allows selection of multiple items from a list by moving items between two lists

Beyond the basic GUI

With a scope that extends beyond the GUI, JClass provides a variety of high-value components and utilities for associated functions and activities such as printing (JClass PageLayout), JAR building and optimization (JClass JarMaster), and database connectivity (JClass DataSource). No equivalents are available in Swing. While this absence is not surprising, given that Swing is strictly GUI-focused, these higher-level functions complement the GUI features as they enable developers to build more robust and scalable solutions for enterprise-class GUI applications.

Database Interfaces JClass HiGrid is a unique grid that, in combination with JClass DataSource, enables developers to build sophisticated database interfaces. HiGrid presents hierarchical data as a tree of database tables, with each level of indenting reflecting the nesting of queries. JClass HiGrid and JClass DataSource together automate the management, display and updating of relational data. JClass DataSource is capable of binding to any JDBC database or in-memory object and can display dynamic hierarchical data structures in array or unbound mode. JClass DataSource offers data-bound versions of popular Swing components such as TextField, ListBox and Label.

JClass HiGrid displays each data level as a table in an outliner. Each subquery result set is shown as a separate indented table. Each node can be collapsed or expanded to show varying levels of detail on particular data rows.

JClass HiGrid's built-in customizer enables complete configuration of data selection and display, all without any programming. The customizer automatically generates all SQL statements needed to access data. Plus, developers can modify a grid's appearance by changing its fonts, border, styles and colors. Powerful cell editors and renderers provide complete control over input and display.

Using the powerful data connectivity capabilities of JClass, developers can build applications that enable advanced data manipulation right inside the interface. This is ideal for applications with large amounts of complex, hierarchical data such as financial portfolio, customer management or inventory control systems.

Data Input and Validation

Swing provides basic data entry components such as text fields, text areas and combo boxes, but these components support only basic functionality. Support for features such as input masks, automatic data validation or international localization is missing. JClass Field enables developers to create solid data entry user interfaces with very little effort.

Conclusion While Swing clearly represents a significant progression in the development of GUI development tools for the Java language, it has not closed the book on the subject. Swing offers major advantages over older heavyweight components such as AWT, but still lacks some critical features that professional developers require if they are to build robust, scalable applications for business. These holes in the Swing armor, however, are amply compensated for by the high-quality, award-winning tools contained in the JClass family of JavaBeans and components.

The benefits of adding JClass to a Swing development environment are numerous:

  • high-quality, well-tested, reliable GUI components
  • visual ease-of-use and IDE compatibility
  • advanced charting and graphing
  • numerous extensions and enhancements to Swing components
  • superior table capabilities for data-intensive applications
  • high-value functionality for peripheral activities including deployment and printing
  • superior data connectivity for building database-driven GUI applications
  • cost-effectiveness through long-term reuse
These reusable components offer a cost-effective, long-term solution to real-world GUI application development and are making Swing developers around the world substantially more productive.

Copyright© 1999 Sitraka Inc.

 

 

 

   
contact | home | privacy policy |
copyright © 2003 Bluestone Consulting, Inc.