Building Modern GUI with Java™ and Netbeans™

cabbagepatchtexasSoftware and s/w Development

Jun 5, 2012 (5 years and 16 days ago)

3,258 views

Building Modern GUI with
Java™ and Netbeans™
Sebastien Stormacq
Software Architect
Sun Microsystems
Agenda
Agenda

Consumer JRE

Matisse

Swing Application Framework

Bean Binding

Java FX
2007 JavaOne
SM
Conference | Session TS-3160 |
3
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 JavaOne
SM
Conference | Session TS-3160 |
4
Completed Java SE Platform
Downloads
Windows numbers only
2007 JavaOne
SM
Conference | Session TS-3160 |
5
Java SE Platform:
The Consumer Web Client

JDK v.6 update for consumers

Based on JDK v.6

Planned
1
st
half 200
8
(1
.6.0_03 ?)

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
Netbeans GUI Builder : Matisse
Matisse – The First of Its Kind

GUI design should be
SIMPLE

Your GUI should look right
EVERYWHERE

Your GUI should look right across (human) languages

Your GUI should follow interface guidelines...
Matisse – A Pratical Example
You will read this line faster...
... than
you
will
read
this
Matisse – A Practical Example

So why do so many UIs look like this?
Matisse

Simple and intuitive GUI layout

Suggests component alignment and spacing

Introduces the GroupLayout manager
>
Compatible with JDK 1.4, 5.0. Standard in 6.

Transparent Internationalization
Swing Application Framework
2007 JavaOne
SM
Conference | Session TS-3160 |
12
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
For More Information

Source code, docs, and binaries on java.net project:
http://appframework.dev.java.net

Questions, comments, etc to:
users@appframework.dev.java.net
Beans Binding
2007 JavaOne
SM
Conference | Session TS-3160 |
15
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
General Data Flow
For More Information

http://beansbinding.dev.java.net

Shannon Hickey's Blog :
http://weblogs.java.net/blog/shan_man
2006 JavaOne
SM
Conference | Session 1076 |
© 2007
Sun Microsystems
<code/>
18
DEMO
Bean Binding with Netbeans (Led Ticker)
JavaFX Script
20
Questions ...

Why does it take a long time to write GUI
programs?

How can we avoid the “
Ugly Java GUI

stereotype?

Why do Flash programs look different
than Java programs?

Why does it seem easier to write web-apps
than Swing programs?

And how can we avoid having an enormous,
writhing mass of listener patterns?
21
Java FX Script
What Is JavaFX Script?

Programming Language for the Java Platform

Object-oriented

Declarative Syntax

Statically-typed + type-inference

Automatic data binding

Extensive Widget library encompassing Swing
and Java 2D API

Development tools including NetBeans and
Eclipse IDE plugins
22
What Problem Does
JavaFX Script Solve?

Fundamentally: how can we make GUI
development more efficient?

GUI development is a collaboration between
content designers, graphic artists, and
programmers

The main bottleneck in this process appears to
the programmers and not the content designers
or graphic artists

But what exactly is making the developer
inefficient?
23
The “Ugly Java GUI” Stereotype

AWT/Swing Container/Component Hierarchy

A tree of rectangular (mostly gray) boxes

If all you do is compose Swing components together,
the result is typically “the Ugly Java GUI”

Same problem exists with other toolkits, e.g., GTK, VB

UI Designers and Swing programmers are using
different building blocks

UI Designers compose designs in tools like Photoshop
and Illustrator

The building blocks they use have direct analogs in
Java 2D, but not always directly in Swing
24
“Ouch”
25
DEMO
JFX PDF Reader
26
Why Do Flash Programs Look
Different Than Java Programs?

Actually—they don’t

Java 2D can do what Flash does—
You just have to use it!

Demos

Cereal

Tesla
2006 JavaOne
SM
Conference | Session 1076 |
© 2007
Sun Microsystems
<code/>
27
DEMO
Sample Java FX Applications
28
For More Information
http://openjfx.org
http://blogs.sun.com/chrisoliver/
http://www.sun.com/javafx
29
Thanks