Navigation Bar

Column Head: About Swing

Column Heading: Component APIs

App Service APIs

Heading: Miscellaneous

Heading: Pluggable L&F APIs

Download Swing Swing JavaDoc APIs JDK 1.1.4 Documentation
JDK 1.1.4 Download
JFC Web Site README

Page Heading: Introducing Swing

Welcome to Swing 0.5, the final pre-beta Swing release from the JavaSoft division of Sun Microsystems Inc. This release is the first preliminary version of Swing that's recommended for use in application development (with the usual disclaimers, of course, meaning that we're not responsible for any damages if the surprising and unexpected happens and something in Swing fails to work as claimed). What we do promise is that we won't knowingly be making any more changes in Swing from now on that will prevent programs written right now, with Version 0.5, from continuing to work as advertised throughout the beta cycle and right on into the final release of Swing. But the pluggable look-and-feel APIs -- those in the swing.basic and swing.plaf packages -- are still subject to change during beta.

Anyway, this is the last preliminary version of Swing that you'll be seeing before the beta version of Swing is distributed. So this release represents the final phase in the current effort by JavaSoft to create and distribute the beta version of the Swing component set with the active assistance of developers.

Because the beta release date is almost upon us, this is also the last chance that you'll have to supply feedback that we can incorporate into the first beta release of Swing. So if there's anything in Swing that doesn't work the way you want it to -- or if there are any major bugs that may impact your use of Swing -- please tell us about it now (see the feedback section farther down on this page).


This preliminary release of Swing (Version 0.5) has one thing in common with all the other pre-beta versions you've seen -- it's packed with new classes, new features, and new capabilities.

From a technical point of view, the biggest news this month is that the Swing set now includes a completely rewritten and streamlined Swing's JTable class, which is more powerful, more versatile, and much easier to use than previous versions of JTable.

And in a development that will be even more exciting to many developers, Swing now has some exciting new built-in tools that let you use JDBC -- the JFC's database-interface mechanism -- to connect JTable components to virtually any kind of relational database management system, including Oracle, Sybase, Informix, IBM DB2, Microsoft SQL Server, and more.

Because the JDBC mechanism is compatible with ODBC-based databases, such as Microsoft Access, you can also use JTable components to connect your applications to smaller, locally installed ODBC databases such as Microsoft Access.

New Demo Shows Off Swing's DB Support

To demonstrate how JTable's database connectivity can work in a real application, this Swing release includes a pair of new example programs named TableExample1 and TableExample2.The TableExample programs show how you can use a JTable component to access data from the database of your choice -- such as Sybase, Oracle, DB2, Microsoft SQL Server, or even MS Access -- and can then view or manipulate that data using JTable components and other kinds of Swing controls.

To learn more about how Swing and relational databases can now work together, see Page 2 of this documentation set, "Database Connectivity."

Other New Features in This Release

Other Swing features making their debut in this release include:

  • Full JavaBeans support, including BeanInfo classes for all Swing components
  • Across-the board support for serialization of Swing components
  • New common dialog classes, including classes that can be used to create Option (message-box) dialogs and color, font, and file-chooser dialog boxes
  • New text-editing features that include a first pass at creating a Swing HTML viewer.

For more details about what's new in this release, see the CHANGES.txt document and the APIs that cover whatever topic you're interested in.

New Class Names and the ClassRenamer Tool

If you didn't got around reading up on the last preliminary release of Swing -- Version 0.4, which was distributed about a month ago -- you may have missed out on the fact that with the release of Version 0.4, many Swing classes were renamed or relocated to subordinate packages. Because of these changes, both Version 0.4 and Version 0.5 of Swing (this one) are effectively incompatible with Swing 0.3 and all other previous releases.

To simplify the job of updating existing classes to Swing's new naming conventions, Release 0.4 included a "ClassRenamer" utility that can be used to convert Swing 0.3 source code to Swing 0.4. That ClassRenamer tool is also included in this release.

You can find the ClassRenamer utility in the swing-0.4/bin directory. To run ClassRenamer over your source files, navigate to its directory and execute the ClassRenamer command using the following syntax:

java ClassRenamer -classpath 
   <swing>\bin;%CLASSPATH% *.java

ClassRenamer doesn't handle batch, shell-wrapper files, or do anything else that could be considered fancy. We've kept it simple because it's a temporary solution to a temporary problem; it will no longer be supplied once the beta release is distributed, so use it while you can.

For more details on how Swing's new naming convention works, see the spec sheet titled "Swing Packaging (A Naming Dilemma and a Proposed Solution)."


Heading: What Is Swing?

Icon: Duke MascotAs everyone who keeps up with trends in Java surely must know by now, Swing is a new set of GUI components, implemented in 100% Pure Java, with a host of new features and a new "Pluggable Look and Feel" design that can make them automatically look and behave just like components that are native to whatever platform they are running on. (For more details, see the Swing Overview page.)

Swing components are based on the Lightweight UI Framework that is familiar to JDK 1.1 users. But their pluggable-look-and-feel architecture lets you easily create a single set of GUI components that can automatically implement the appearance and behavior of components designed for any OS platform -- including Windows, Solaris, Macintosh, or any customized look and feel that you might want to design.

The Swing tool set is a subset of the Java Foundation Classes (JFC), an umbrella designation for a large collection of classes designed for building visual applications in Java. (JFC includes not only the Swing component set, but also the familiar AWT (Abstract Windows Toolkit), and Java2D.) Engineering teams from JavaSoft and Netscape are working closely together to define and develop Swing, along with the rest of JFC. A migration plan is being created to help IFC developers move as quickly as possible to the JFC.

Swing components include 100% Pure Java versions of the existing AWT component set (Button, Scrollbar, List, and so on), plus a rich Pure Java set of higher-level components (such as tree-view, list-box, and tabbed-pane components).


Heading: Online Java Tutorial Features Swing

Icon: New!The next edition of The Java Tutorial, the best-selling self-guided tour of the Java programming language from JavaSoft and Addison-Wesley, will feature a brand-new section all about Swing.

Image: Tutorial CoverAnd -- guess what! You can get a sneak preview of the Tutorial's new Swing section right now! Just follow this link--

Tutorial Link Button Yes: Show me the Tutorial!

-- and then surf on over to other sections of the Tutorial that present an overview of Swing components, tips on getting started with Swing, and separate individual subsections that show how to use each Swing component.

Be sure to check the Tutorial link often (you can also find it on the home page) because it's updated frequently -- almost every day there's a new code example, a new explanation of how to do something, or something else that's new. And it's dynamically liked to this document set, so if you don't check out our Tutorial link often, you'll never know what you're missing!

The Java Tutorial is written by Mary Campione and Kathy Walrath of the Java team at JavaSoft. It is the only Java tutorial that JavaSoft officially endorses.


Image: MailboxAs the beta release of Swing draws near, we continue to welcome feedback from developers -- especially bug reports, which are particularly important as Swing development enters its final stages.

If you have feedback about important issues regarding Swing, please mail it to:

swing-feedback@java.sun.com

We can't promise at this late date that we'll respond personally to every feedback message. But please do send us feedback about issues that you consider really important. We'll carefully consider your ideas, remarks, suggestions, and comments.


Heading: The Specifications

The specifications in this document package describe and illustrate the infrastructure -- that is, the underlying services and patterns -- that are the building blocks of the Swing component set. Some of the most important documents in this set are described below. Follow the links for more detailed information on each topic explored in this document set.

Database Connectivity

Page 2 of this document, "Database Connectivity," describes Swing's new and improved JTable class and shows how you can connect your applications to relational databases using Swing components. It also shows how you can then use your Swing components to build full-featured database-connectable applications.

Swing Overview

The "Swing Overview" section is a two-page description of Swing and its parts. It is recommended reading for anyone who isn't very familiar with Swing. It explains why Swing was invented, how Swing components work, and how they can help you create flexible and powerful components for your Java applets and applications.

Swing Component Architecture

The page titled "Swing Architecture" goes into more detail about the architecture of Swing components, focusing on the features of Swing components that make their pluggable L&F capabilities possible. It describes and demonstrates the modified form of model-view-component (MVC) architecture on which all Swing components are based, and it shows how you can use Swing components in your applications.

The FAQ Forum

This month's FAQ Forum is the last edition pre-beta FAQ coluimn. In this last edition of FAQ Forum, the Swing design team answers the questions that developers have asked most frequently in the thousands of e-mail messages that we have received on our feedback hotline.

With this release -- our last pre-beta release -- our JavaSoft experts answer questions on topics ranging from Swing's new naming conventions to how we've optimized the speed of Swing. You may find answers to your questions here before you've even gotten around to asking them.

Left Arrow Top Arrow Right Arrow


Version 0.5. Last modified 10/6/97.
Copyright © 1995-97 Sun Microsystems, Inc. All Rights Reserved.

Sun Logo