Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Swing is not dead


Published on

Swing and Swing-related libraries.

Published in: Education, Technology
  • Be the first to comment

Swing is not dead

  1. 1. Technical Thursdays January , 20 11 Piotr Dziewonski
  2. 2. Agenda <ul><li>Introduction </li></ul><ul><li>AWT and Java 2D </li></ul><ul><li>Swing Application Framework </li></ul><ul><li>Swing enhancements: </li></ul><ul><li>Substance </li></ul><ul><li>Flamingo </li></ul><ul><li>Oxbow </li></ul><ul><li>MiGLayout </li></ul><ul><li>SwingLabs </li></ul><ul><li>Aerith </li></ul><ul><li>Swing in future </li></ul>
  3. 3. Abstract Window Toolkit (AWT) <ul><li>T he first graphical user interface (GUI) toolkit that shipped with Java (JRE 1.0) </li></ul><ul><li>AWT was the only core library for user interface programming in Java </li></ul><ul><li>AWT provides this capability by calling upon the native libraries on the user’s system to create and display these GUI components </li></ul><ul><li>Events that occur in the native window system are received by the AWT implementation and are then forwarded to Java applications as AWT events </li></ul><ul><li>AWT lives on and can be used now exactly as it was in the beginning </li></ul>
  4. 4. Java 2D <ul><li>Java 2D, introduced in the JDK 1.2 release, is the graphics library of Java. Whereas AWT included basic drawing APIs in JDK 1.0, Java 2D goes much further and covers a broad set of operations, including basic and advanced drawing operations, image manipulation, text, and printin g. </li></ul><ul><li>Java 2D handles Swing’s rendering operations. So, for example, when a Swing button wants to look like a Swing button, it makes calls into Java 2D to draw the background, the border, and the text for that button. </li></ul>
  5. 5. Swing – Introduction <ul><li>Swing  is the primary Java GUI widget toolkit released in July 1997 . It is part of Sun Microsystems' Java Foundation Classes (JFC) — an API for providing a graphical user interface (GUI) for Java programs. </li></ul><ul><li>Swing was developed to provide a more sophisticated set of GUI components than the earlier Abstract Window Toolkit (AWT) . Swing provides a native look and feel that emulates the look and feel of several platforms, and also supports a pluggable look and feel that allows applications to have a look and feel unrelated to the underlying platform . </li></ul><ul><li>Source: </li></ul>
  6. 6. Swing – Overview <ul><li>Swing, like Java 2D, was also introduced in JDK 1.2. </li></ul><ul><li>Swing is a lightweight toolkit, which means that the Swing components you see in your application, such as buttons, checkboxes, and scrollbars, do not correspond to native c o mponents as they do in AWT. </li></ul><ul><li>Swing’s components are drawn using Java 2D, and they can have their drawing customized, which leads to applications that look and behave in much more interesting ways. </li></ul><ul><li>The application may call Swing methods directly, but the functionality of these methods is handled through combinations of AWT and Java 2D calls underneath </li></ul>
  7. 7. Swing – Overview Java Application Java Runtime Environment Swing Java 2D AWT
  8. 8. Swing – Competitors <ul><li>JavaFX </li></ul><ul><li>Adobe Flex </li></ul><ul><li>Adobe Air </li></ul><ul><li>Microsoft Silverlight </li></ul><ul><li>HTML/CSS/JavaScript </li></ul><ul><li>… </li></ul>
  9. 9. Swing Application Framework <ul><li>The  Swing Application Framework  (JSR 296) is a Java specification for providing a simple application framework for Swing applications. It will define infrastructure common to most desktop applications, making Swing applications easier to create. </li></ul><ul><li>The JSR 296 specification will define the basic structure of a Swing application. It will define a Framework as a small set of extensible classes that define infrastructure common to most desktop applications: </li></ul><ul><li>Management of application life-cycle, startup and shutdown, </li></ul><ul><li>Support for loading localized resources, </li></ul><ul><li>Persistent session state, </li></ul><ul><li>Support for loosely coupling Actions to their presentation </li></ul><ul><li>Sources: </li></ul><ul><li> </li></ul>
  10. 10. But… <ul><li>It was originally expected that this implementation would be the means for integrating JSR 296 into the upcoming Java SE 7 (Dolphin) version of the Java programming language, and the project was scheduled to be included in milestone 5 of the JDK7 development. However, in August 2009, it was announced that the project would not be included due to an inability to reconcile design flaws and achieve consensus among the JSR 296 team before the milestone 5 deadline . </li></ul><ul><li>Source: </li></ul>
  11. 11. BSAF – overview <ul><li>The Better Swing Application Framework is a fork of the original Swing Application Framework reference implementation of JSR 296. Since August 2009, the original Swing Application Framework project has been on hold, and therefore this fork was created to carry on the work until the original project resumes. </li></ul><ul><li>The last public release of the original SAF project was version 1.03. The BSAF project currently aims at producing a new release, version 1.9, with the primary goals of improving stability, keeping backward compatibility with SAF 1.03, fixing bugs, updating documentation, and creating more unit tests and examples. </li></ul>Project name: Better Swing Application Framework Author: Alexander Potochkin Web page: License: LGPL Description: A fork of the Swing Application Framework .
  12. 12. Substance – overview <ul><li>The goal of this project is to provide a rock solid, fast and extensible library for creating visually appealing and consistent Swing applications . </li></ul>Project name: substance Author: Kirill Grouchnikov Web page: License: BSD License Description: Substance Java look & feel . Say something about trident …
  13. 13. Substance – in Action…
  14. 14. Substance – in Action…
  15. 15. Flamingo – overview <ul><li>The goal of this project is to provide a Swing implementation of the Office 2007 ribbon container and related components. The components have consistent visuals under the existing core and third-party look-and-feels, respect the DPI settings of the user desktop and follow the core Swing guidelines in the external APIs and the internal implementation details. </li></ul><ul><li>Ribbon component is described here: </li></ul><ul><li> </li></ul>Project name: flamingo Author: Kirill Grouchnikov Web page: License: BSD License Description: Flamingo Swing component suite .
  16. 16. Flamingo – inspiration
  17. 17. Flamingo – in Action…
  18. 18. Flamingo – the small things <ul><li>More information on Kirill’s blog: </li></ul><ul><li> </li></ul>
  19. 19. Oxbow – overview <ul><li>The goals are : </li></ul><ul><li>create trivial Task Dialog API as described at Microsoft page: </li></ul><ul><li>provide Look and Feel independent UI </li></ul><ul><li>conform as much as possible to local OS standards when using system LAF </li></ul>Project name: oxbow Author: Eugene Ryzhikov Web page: License: New BSD License Description: A collection of projects for Swing UI enhancements .
  20. 20. Oxbow – inspiration
  21. 21. Oxbow – in Action…
  22. 22. MiGLayout – overview <ul><li>MiG Layout Philosophy : </li></ul><ul><li>Fast, Small and Memory Efficient </li></ul><ul><li>Simple to Use + High End = Large Range </li></ul><ul><li>GUI Toolkit Independent – Easy to Port </li></ul><ul><li>Resolution Independence – Automatically </li></ul><ul><li>Simple to Read – Close Constraint Proximit y </li></ul>Project name: MiGLayout Author: Mikael Grev Web page: License: BSD License Description: A collection of projects for Swing UI enhancements .
  23. 23. MiGLayout – in Action…
  24. 24. SwingLabs – overview <ul><li>Available components include : </li></ul><ul><li>Sorting, filtering, highlighting for tables, trees, and lists </li></ul><ul><li>Find/search </li></ul><ul><li>Auto-completion </li></ul><ul><li>Login/authentication framework </li></ul><ul><li>TreeTable component </li></ul><ul><li>Collapsible panel component </li></ul><ul><li>Date picker component </li></ul><ul><li>Tip-of-the-Day component </li></ul><ul><li>Source: </li></ul>Project name: SwingLabs Author: Sun Microsystems, Inc. Web page: License: LGPL Description: Sun  o pen source project proposing extensions to the Java Swing GUI toolkit .
  25. 25. SwingLabs – overview <ul><li>A Successful project components are eventually incorporated into the core Swing toolkit for future Java versions, although API compatibility is not guaranteed. Examples of these are: </li></ul><ul><li>the GroupLayout manager in Java SE 6 </li></ul><ul><li>incorporation of the SystemTray in Java SE 6 </li></ul><ul><li>the new Desktop class in Java SE 6, which allows to launch easily associated applications registered on the native desktop, as for example : launching the user-default browser, launching the user-default mail client, launching a registered application to open, edit or print a specified file. </li></ul><ul><li>Source: </li></ul>
  26. 26. SwingLabs – inspiration
  27. 27. SwingLabs – in Action…
  28. 28. Aerith – overview <ul><li>It's a roadtrip slideshow builder that combines Google Maps, Flickr, and Yahoo Geocode to let you make your own slideshow of photos you took on your trip. Once you are doing setting up the slideshow you can share the trip with your friends as an applet. </li></ul><ul><li>Aerith really shows off the power of Swing, Java2D, and JOGL when you combine it with webservices and applets. With Desktop Java you can do things you couldn't ever do in AJAX. And most importantly, it looks great! </li></ul>Project name: Aerith Author: Richard Bair, Romain Guy, and Joshua Marinacci Web page: License: BSD License Description: Aerith is a Swing Mashup .
  29. 32. Resources <ul><li>Books: </li></ul><ul><li>Filthy Rich Clients: Developing Animated and Graphical Effects for Desktop Java Applications – Chet Haase, Romain Guy </li></ul><ul><li>The Definitive Guide to Java Swing (3rd Edition) – John Zukowski </li></ul><ul><li>Web: </li></ul><ul><li>Jonathan Giles – </li></ul><ul><li>Kirill Grouchnikov – </li></ul><ul><li>Other: </li></ul><ul><li>Check „TechnicalThursdays” directory on the storage </li></ul>
  30. 33. Q & A