AWT and Swing Improvements in Mustang
By Roman Strobl on X 21, 2005
Scott Violet visited Prague this week and he had a tech talk about improvements of AWT and Swing in Java SE 6 (Mustang). Some of these are pretty interesting and it wouldn't be me if I would not share the information (yes, I asked for permission first). Most of these features are already done, some are still being finalized for final release of Mustang.
Major news in AWT:
- Desktop related APIs - these enable you to execute native actions such as to launch a browser, open a mail composer, open the file or print the file - all these actions are processed by applications which are associated with the file type. Thus you can easily print a PDF from Java using Adobe Acrobat.
- Tray icon improvements - tray icon of your Java application becomes native-like, it gets a pop-up menu, tooltip, image and you can add listeners for various events.
- Instant splash screen - a splash screen can be launched even before the VM machinery starts, it can be either specified on command line or launched programatically - and it can be dynamic (e.g. including a progress bar)
- New modality API - modal dialogs are handeled in a better way - java help can be non-blocking, each document can have it's own modal dialogs, modal dialogs always stay on top, etc.
- Look and feel improvements - great look of Java on the upcoming Windows Vista and better GTK (with more general support for themes)
- SwingWorker - utility which makes Swing threading easier, now a part of Swing
- Layout enhancements - most of the stuff comes from Matisse - baseline support supported on almost all components
- True double buffering - no more "gray rect" bug - the second buffer is used for repainting, so Java apps look more native
- More: drag and drop enhancements, text printing with formatting, JTable sorting and filtering, tabs treated as components, etc.