swing is not dead

33
Technical Thursdays January, 2011 Piotr Dziewonski

Upload: piotr-dziewonski

Post on 20-May-2015

3.526 views

Category:

Education


0 download

DESCRIPTION

Swing and Swing-related libraries.

TRANSCRIPT

Page 1: Swing is not dead

Technical ThursdaysJanuary, 2011

Piotr Dziewonski

Page 2: Swing is not dead

AgendaIntroductionAWT and Java 2DSwing Application FrameworkSwing enhancements:SubstanceFlamingoOxbowMiGLayoutSwingLabsAerithSwing in future

Page 3: Swing is not dead

Abstract Window Toolkit (AWT)The first graphical user interface (GUI) toolkit that shipped

with Java (JRE 1.0)AWT was the only core library for user interface

programming in JavaAWT provides this capability by calling upon the native

libraries on the user’s system to create and display these GUI components

Events that occur in the native window system are received by the AWT implementation and are then forwarded to Java applications as AWT events

AWT lives on and can be used now exactly as it was in the beginning

Page 4: Swing is not dead

Java 2DJava 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 printing.

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.

Page 5: Swing is not dead

Swing – IntroductionSwing 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.

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.

Source: http://en.wikipedia.org/wiki/Swing_(Java)

Page 6: Swing is not dead

Swing – OverviewSwing, like Java 2D, was also introduced in JDK 1.2.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 components as they do in AWT.

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.

The application may call Swing methods directly, but the functionality of these methods is handled through combinations of AWT and Java 2D calls underneath

Page 7: Swing is not dead

Swing – Overview

Java Application

Java Runtime Environment

Swing

Java 2D AWT

Page 8: Swing is not dead

Swing – Competitors

JavaFXAdobe FlexAdobe AirMicrosoft SilverlightHTML/CSS/JavaScript…

Page 9: Swing is not dead

Swing Application FrameworkThe 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.

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:Management of application life-cycle, startup and shutdown,Support for loading localized resources,Persistent session state,Support for loosely coupling Actions to their presentation

Sources: http://en.wikipedia.org/wiki/Swing_Application_Frameworkhttp://www.artima.com/lejava/articles/swingframework.html

Page 10: Swing is not dead

But…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.

Source: http://weblogs.java.net/blog/archive/2009/08/19/saf-and-jdk7

Page 11: Swing is not dead

BSAF – overview

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.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.

Project name: Better Swing Application FrameworkAuthor: Alexander PotochkinWeb page: http://kenai.com/projects/bsaf/pages/HomeLicense: LGPL Description: A fork of the Swing Application Framework.

Page 12: Swing is not dead

Substance – overview

The goal of this project is to provide a rock solid, fast and extensible library for creating visually appealing and consistent Swing applications.

Project name: substanceAuthor: Kirill GrouchnikovWeb page: https://substance.dev.java.net/License: BSD License Description: Substance Java look & feel.

Say something about trident…

Page 13: Swing is not dead

Substance – in Action…

Page 14: Swing is not dead

Substance – in Action…

Page 15: Swing is not dead

Flamingo – overview

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.

Ribbon component is described here:http://msdn.microsoft.com/en-us/library/cc872782.aspx

Project name: flamingoAuthor: Kirill GrouchnikovWeb page: https://flamingo.dev.java.net/License: BSD License Description: Flamingo Swing component suite.

Page 16: Swing is not dead

Flamingo – inspiration

Page 17: Swing is not dead

Flamingo – in Action…

Page 18: Swing is not dead

Flamingo – the small things

More information on Kirill’s blog:

http://www.pushing-pixels.org

Page 19: Swing is not dead

Oxbow – overview

The goals are: create trivial Task Dialog API as described at Microsoft page:

http://msdn.microsoft.com/en-us/library/aa511268.aspx

provide Look and Feel independent UI conform as much as possible to local OS standards when using

system LAF

Project name: oxbowAuthor: Eugene RyzhikovWeb page: http://code.google.com/p/oxbow/License: New BSD License Description: A collection of projects for Swing UI

enhancements.

Page 20: Swing is not dead

Oxbow – inspiration

Page 21: Swing is not dead

Oxbow – in Action…

Page 22: Swing is not dead

MiGLayout – overview

MiG Layout Philosophy: Fast, Small and Memory Efficient Simple to Use + High End = Large Range GUI Toolkit Independent – Easy to Port Resolution Independence – Automatically Simple to Read – Close Constraint Proximity

Project name: MiGLayoutAuthor: Mikael GrevWeb page: http://www.miglayout.com/License: BSD License Description: A collection of projects for Swing UI

enhancements.

Page 23: Swing is not dead

MiGLayout – in Action…

Page 24: Swing is not dead

SwingLabs – overview

Available components include: Sorting, filtering, highlighting for tables, trees, and lists Find/search Auto-completion Login/authentication framework TreeTable component Collapsible panel component Date picker component Tip-of-the-Day component

Source: http://en.wikipedia.org/wiki/SwingLabs

Project name: SwingLabsAuthor: Sun Microsystems, Inc.Web page: http://www.swinglabs.org/License: LGPLDescription: Sun open source project proposing

extensions to the Java Swing GUI toolkit.

Page 25: Swing is not dead

SwingLabs – overviewA 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:the GroupLayout manager in Java SE 6incorporation of the SystemTray in Java SE 6the 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.

Source: http://en.wikipedia.org/wiki/SwingLabs

Page 26: Swing is not dead

SwingLabs – inspiration

Page 27: Swing is not dead

SwingLabs – in Action…

Page 28: Swing is not dead

Aerith – overview

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.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!

Project name: AerithAuthor: Richard Bair, Romain Guy, and Joshua MarinacciWeb page: https://aerith.dev.java.net/License: BSD License Description: Aerith is a Swing Mashup.

Page 29: Swing is not dead
Page 30: Swing is not dead
Page 31: Swing is not dead
Page 32: Swing is not dead

ResourcesBooks:Filthy Rich Clients: Developing Animated and Graphical Effects for Desktop Java Applications – Chet Haase, Romain GuyThe Definitive Guide to Java Swing (3rd Edition) – John Zukowski

Web:Jonathan Giles – www.jonathangiles.netKirill Grouchnikov – www.pushing-pixels.org

Other:Check „TechnicalThursdays” directory on the storage

Page 33: Swing is not dead

Q & A