Desktop ™ Technology

Thorsten Laux Chet Haase , Inc.

TS-3160

2007 JavaOneSM Conference | Session TS-3160 | Goal

Where We Are Where We’re Going

2007 JavaOneSM Conference | Session TS-3160 | 2 Agenda

State of the Desktop World Where We Are Going Consumer JRE Release Future Platform Features

2007 JavaOneSM Conference | Session TS-3160 | 3 Agenda

State of the Desktop World Where We Are Going Consumer JRE Release Future Platform Features

2007 JavaOneSM Conference | Session TS-3160 | 4 How Much Java Technology Is Out There?

● > 91% of all PCs run Java platform*

● ~ 77% of all Java technology-enabled PCs run Sun’s Java Platform, Standard Edition (Java SE platform)**

● Distribution through PC OEMs

● Nine of the top ten PC OEMs ship the JRE software

● Representing > 60% of all shipped PCs

● 58 white box vendors have signed JRE software redistribution agreements

● Download/installs

● ~ 44m installations/month for the last six months on Windows

● > 50M in January, February, April, 2007

* Omniture, April 2007 **Mapsolute/Map24.com, April 2007 2007 JavaOneSM Conference | Session TS-3160 | 5 Completed Java SE Platform Downloads Windows numbers only

55,000,000

50,000,000

45,000,000

40,000,000

35,000,000

30,000,000

25,000,000

20,000,000

15,000,000

10,000,000

5,000,000

0 1/2003 1/2004 1/2005 1/2006 1/2007

2007 JavaOneSM Conference | Session TS-3160 | 6 Where Does the Time Go? Evans Data Survey: Fall 2006 45

40

35

30 Desktop 25 Server Mobile 20 Others

15

10

5

0

Percentage of Java Development Time Spent Spring 05 Fall 05 Spring 06 Fall 06

2007 JavaOneSM Conference | Session TS-3160 | 7 Blurb.com Photo Album Creation and Publishing

2007 JavaOneSM Conference | Session TS-3160 | 8 Map24.com

● Maps, directions, local search in an applet

● Used on Yahoo’s European sites

● “One Million Applet Downloads a Day”

● Thursday@4:10

2007 JavaOneSM Conference | Session TS-3160 | 9 Google Presentation PowerPoint Viewer

2007 JavaOneSM Conference | Session TS-3160 | 10 CineShot Real-Time Quality Analysis and Capture for Video

2007 JavaOneSM Conference | Session TS-3160 | 11 Lightzone Photographic Digital Image Editing

2007 JavaOneSM Conference | Session TS-3160 | 12 MySpace Project Inglewood Media file uploader applet

● Most popular website in the galaxy (dude)

● Needed Java platform for richness + local access

2007 JavaOneSM Conference | Session TS-3160 | 13 Agenda

State of the Desktop World Where We Are Going Consumer JRE Release Future Platform Features

2007 JavaOneSM Conference | Session TS-3160 | 14 Where We Are Going

™ ● JavaFX Script technology

● Expanding the developer base ™ ● (JDK ) 6 Update for Consumers, JDK version 7

● JavaFX Mobile technology

● Java SE platform on Mobile Devices

● OpenJDK

● Open Sourcing the JDK

2007 JavaOneSM Conference | Session TS-3160 | 15 Expanding the Developer Base

Java Software Developers JavaFX Script

Script Developers Skill Required Visual Designers

Volume

2007 JavaOneSM Conference | Session TS-3160 | 16 JavaFX Script Technology

● Declarative, statically typed scripting language

● Enables easier building and running of media-rich Java clients ™ ● Makes and API accessible to a much larger audience

● Early access available for the desktop now

● More at

● Keynote: Today@1:30PM

● Presentation: Wednesday@4:10PM, Thursday@1:30PM

● Lab: Thursday@3:50PM

● Chris Oliver’s blog: demos, tutorial http://blogs.sun.com/chrisoliver

2007 JavaOneSM Conference | Session TS-3160 | 17 DEMO

JavaFX Technology

2007 JavaOneSM Conference | Session TS-3160 | 18 Java SE Platform: The Consumer Web Client

● Traditional sweet spots

● The first wave of Java v.1.1 consumer applets

● Enterprise applications and applets ™ ● Developer tools (NetBeans IDE, , IDEA…)

● Large consumer desktop applications (LimeWire, Azureus…)

● The world has changed

● Java SE platform is now installed on most desktops

● Rich consumer clients and media are rapidly gaining importance

● The time is right for Java SE platform to become a primary consumer web client platform 2007 JavaOneSM Conference | Session TS-3160 | 19 Java SE Platform: The Consumer Web Client

● JDK v.6 update for consumers

● Based on JDK v.6 st ● Planned 1 half 2008

● Eliminates the most important consumer issues

● Startup time, Download size, Install experience, Modern cross-platform L&F

● Will include JavaFX Script technology

● JDK v.7

● Will have a new focus on consumer relevant features

● Media, Graphics, Animation, 3D support

2007 JavaOneSM Conference | Session TS-3160 | 20 JavaFX Mobile Technology: First Step in API Convergence

● Java technology is popular with desktop developers

● Cell phones are more powerful now than desktops were when many Java SE platform APIs were designed

● Sun will make desktop APIs available on future JavaFX stacks ™ ● e.g., Java SE Core APIs, Swing, Java 2D API…

● JavaFX Mobile technology includes Swing and 2D implementations

2007 JavaOneSM Conference | Session TS-3160 | 21 JavaFX Mobile Technology

● Calling all Swing developers Java SE platform and Swing… on a Phone!

● Desktop developers can now target phones with familiar Java technologies

● Go to the Mobility keynote and sessions for more

● Keynote: Today@3:20PM

● “Swing on a phone”

● Has a certain ring to it, doesn’t it?

2007 JavaOneSM Conference | Session TS-3160 | 22 OpenJDK

● How to help Desktop

● SwingLabs, http://swinglabs.dev.java.net

● Still the best place for new feature work projects

● JSR 295/296: java.net projects

● Beans Binding and the Swing Application Framework

● Starter desktop projects for OpenJDK

● Bugs

● Clearing encumbrances

● Session: “How to Hack in the OpenJDK”

● Tuesday @ 6:00PM, Thursday @ 2:50PM

● OpenJDK project: https://openjdk.dev.java.net/

2007 JavaOneSM Conference | Session TS-3160 | 23 Desktop Roadmap (Dates are best-guess and may change) OpenJDK JavaFX for the Desktop JavaFX Script Eval

Consumer Platform Features Consumer Enhancements, JavaFX Script Java SE

2007 2008 2007 JavaOneSM Conference | Session TS-3160 | 24 Agenda

State of the Desktop World Where We Are Going Consumer JRE Release Future Platform Features

2007 JavaOneSM Conference | Session TS-3160 | 25 Java SE Platform v.6: Awesome Desktop Release

● Desktop API

● TrayIcon

● Improved native look & feel

● New OS support (Vista)

● SwingWorker

● Project Matisse and Group Layout

● Gray Rect fix

● JTable Sorting and Filtering

● LCD Text

● Single-Threaded Rendering

● Desktop AA Text Properties

● Better Curved Primitives

● Splash Screen

● Better Security Dialogs

● Graphics Acceleration Improvements

● Is anyone still reading this? 2007 JavaOneSM Conference | Session TS-3160 | 26 2007 JavaOneSM Conference | Session TS-3160 | 27 2007 JavaOneSM Conference | Session TS-3160 | 28 We’re Not Done Yet

● The bad news

● We have problems that need to be fixed

● Startup time, especially at first launch (“coldstart”)

● Install time and process

● JRE software detection and installation

● The good news

● We are aware of the problems

● We’re working on solutions

● We hope to deliver solutions in a reasonable timeframe

2007 JavaOneSM Conference | Session TS-3160 | 29 Problem: Startup Time

● Actually 2 different “startup” problems

● Coldstart: First run since boot

● Typical times: 5–10+ seconds

● Warmstart: After recent run of VM

● Typical times: < 1–2 seconds

● Warmstart is acceptable

● Lots of work over the years + faster machines

● Coldstart is not

2007 JavaOneSM Conference | Session TS-3160 | 30 Problem: Startup Time

● Coldstart is an OS issue

● All about the disk cache

● Java platform reads a lot from disk at startup

● Some improvements over the years

● Class Data Sharing

● Rearranging rt.jar

● OS-level prefetch (native libraries only)

● But it’s still not nearly enough

● What to do?

2007 JavaOneSM Conference | Session TS-3160 | 31 Solution: Quickstarter

● Pre-load the cache, before launch

● At boot, at browser launch, whenever

● Note: Not the same as having a running VM

● Cooperates with the OS

● Memory still available for other apps

● OS will flush disk cache pages as necessary

2007 JavaOneSM Conference | Session TS-3160 | 32 Problem: Install Time

● The JRE implementation is, well, big

● 7–15 MB download

● Extracted to 40+ MB for rt.jar

● Plus other jarfiles, native libraries, resource files, …

● All of this takes time

● Download

● Unzip

● Unpack200

● Copying bits around

● It’s a wonder that it’s as quick as it is…

2007 JavaOneSM Conference | Session TS-3160 | 33 Solution: Kernel

● Every app needs some core functionality

● VM, networking, security, classloader

● …plus other stuff on demand

● Swing, AWT, 2D, CORBA

● Kernel downloads and installs

● Bare essentials immediately

● Additional dependencies next

● “ClassNotFound” culprits as needed

● Everything else eventually

2007 JavaOneSM Conference | Session TS-3160 | 34 Kernel: Bare Essentials

367KB4.3

Core JRE Web Start 9.1 197KB Plug-in Installer 1374KB 3.1 82KB 2.4

2007 JavaOneSM Conference | Session TS-3160 | 35 Kernel: App-Specific Sizes

2007 JavaOneSM Conference | Session TS-3160 | 36 Problem: JRE Software Detection

● No good way to detect JRE software existence and version from browser

● Developers use nifty “Get Java” button

● Which takes users away from the site

● Applets constrained to lowest-common- denominator APIs ™ ● MS VM, circa Java Development Kit (JDK ) 1.1

2007 JavaOneSM Conference | Session TS-3160 | 37 Solution: Deployment Toolkit

™ ● JavaScript technology solution hosted by Sun

● Developer uses simple script on their site

● Link to Sun’s script

● Detects JRE software existence and version

● Depending on app requirements

● Redirects to download site

● Polls for successful install

● Redirects back to original site and launches app or applet

2007 JavaOneSM Conference | Session TS-3160 | 38 Windows Graphics Acceleration

● DirectX9-based pipeline

● High performance for all things 2D/Swing

● Translucency

● Scaling

● Text

● On by default!

2007 JavaOneSM Conference | Session TS-3160 | 39 Nimbus

● Modern

● Cross platform

● Open source community effort

● http://nimbus.dev.java.net

● Scaleable, resolution independent

2007 JavaOneSM Conference | Session TS-3160 | 40 Nimbus Look & Feel

2007 JavaOneSM Conference | Session TS-3160 | 41 Nimbus: SwingSet2

2007 JavaOneSM Conference | Session TS-3160 | 42 Coming Soon: Consumer Java Runtime Environment (JRE™)

● When? Near future: Java SE platform v.6 update

● What?

● Quickstarter

● Kernel

● Deployment Toolkit

● Windows graphics acceleration

● Nimbus look & feel

● Caveat: This is the plan; Plans can change

● Good prototypes of all of these features exist

● …the trick is productizing them

● “Easier Deployment Is Finally Here”: Tuesday, 4:40PM

2007 JavaOneSM Conference | Session TS-3160 | 43 Agenda

State of the Desktop World Where We Are Going Consumer JRE Release Future Platform Features

2007 JavaOneSM Conference | Session TS-3160 | 44 Media

● Java Technology needs a standard media solution

● Media components

● Swing components for video/audio playback

● Support for native formats through native players

● Windows Media Player

● Flash

● DirectShow

● QuickTime

● Cross-platform codec for lightweight integration

2007 JavaOneSM Conference | Session TS-3160 | 45 3D

● You can do 3D with Java platform now

● Applications, applets, and web start

● Seamless deployment of JOGL libraries through plug-in

● Hardware acceleration, cross-platform, modern graphics standard…

● 3D API integrated into the JDK software in the future

● Nothing concrete yet ™ ● API and JOGL BOF

● Thursday@8:55PM

● 3-D Earth Visualization

● Thursday@10:55AM

2007 JavaOneSM Conference | Session TS-3160 | 46 DEMO

3D

2007 JavaOneSM Conference | Session TS-3160 | 47 Animation

● Modern desktops are getting more animated

● Swing’ native look & feel supports basic control animation

● Possible to do much more…but very manual

● We need to make animation much easier

● Need built-in support for:

● Better timing facilities

● Animations and effects

● Related sessions

● Filthy Rich Clients: Wednesday@10:55AM, Friday@2:50PM

● Extreme GUI Makeover: Wednesday@2:50PM

● Bringing Life to Swing Desktop Applications: Friday@10:50

2007 JavaOneSM Conference | Session TS-3160 | 48 Components

● Shaped top-level components

● Translucent windows

● Mixed heavyweights and lightweights

● TreeTable, DatePicker, DirectoryChooser

● Native FileChooser

2007 JavaOneSM Conference | Session TS-3160 | 49 Simplify Building Applications: JSR 296

● Swing Application Framework (JSR 296)

● Canned architecture

● Automatic good housekeeping

● Amenable to tools

● Swing Application Framework goals

● As small and simple as possible (not more so)

● Explain it all in one hour

● Work very well for small/medium apps

● No docking framework, generic data model, scripting language, GUI markup schema, module system

JSR = Java Specification Request 2007 JavaOneSM Conference | Session TS-3160 | 50 Using the Application Framework public class MyApp extends SingleFrameApplication { @Override protected void startup(String[] args) { JLabel label = new JLabel("Hello World"); show(label); } public static void main(String[] args) { Application.launch(MyApp.class, args); } }

● https://appframework.dev.java.net/

● “JSR 296: The Swing Application Framework”

● Tuesday, 3:20PM

2007 JavaOneSM Conference | Session TS-3160 | 51 Simplifying Binding Applications: JSR 295

● Beans Binding (JSR 295)

● Keep two properties in sync

● Trivialize connecting GUI and data

● Eliminate boilerplate, need for comprehensive knowledge of the Swing model APIs

● Amenable to tools

● Conversion, validation, read or read/write

● Deal with the difficult stuff

● Lists, tables, collections

● Selection and multiple-selection

2007 JavaOneSM Conference | Session TS-3160 | 52 Using Beans Binding

Binding customersBinding = new Binding( applicationData, "${customerList}", customersJTable, "elements");

Binding nameBinding = new Binding( customersJTable, "${selectedElement.firstName}", nameTextField, "text");

● https://beansbinding.dev.java.net/

● “Beans Binding”

● Thursday, 4:10PM

2007 JavaOneSM Conference | Session TS-3160 | 53 More Tools Support… (NetBeans™ Software)

● GUI Design

● Continued work on Project Matisse GUI Builder

● Application framework and beans binding support

2007 JavaOneSM Conference | Session TS-3160 | 54 For More Information http://javadesktop.org All things Desktop Java technology related http://java.net Community site for Java technology: projects, blogs, articles http://openjdk.dev.java.net Contribute to the next version

2007 JavaOneSM Conference | Session TS-3160 | 55 Q&A

2007 JavaOneSM Conference | Session TS-3160 | 56 Desktop Java™ Technology

Thorsten Laux Chet Haase Sun Microsystems, Inc.

TS-3160

2007 JavaOneSM Conference | Session TS-3160 |