SlideShare a Scribd company logo
1   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
    reserved.
O Retorno do Rich-Client Java                                                                                                        Translation By:
Apresentado por Stephen Chin                                                                                                         Marcelo Quinta @mrquinta
 2   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Sobre o palestrante: Stephen Chin

    • Evangelista Java/JavaFX na Oracle
    • Autor de vários livros de Java, mais
      recentemente o Pro JavaFX 2
    • Blog: steveonjava.com
    • Twitter: @steveonjava
    • stephen.chin@oracle.com



3   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
    reserved.
Safe Harbor Statement

    The following is intended to outline our general
    product direction. It is intended for information
    purposes only, and may not be incorporated into
    any contract. It is not a commitment to deliver any
    material, code, or functionality, and should not be
    relied upon in making purchasing decisions. The
    development, release, and timing of any features or
    functionality described for Oracle’s products
    remains at the sole discretion of Oracle.



4   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
    reserved.
Recursos da apresentação

• Visite ProJavaFX2.com para baixar o capítulo 1 e
  todos os exemplos
• Site do JavaFX: oracle.com/javafx
• Site do NetBeans: netbeans.org
• Blog fxexperience: fxexperience.com
• Blog do Jim Weaver sobre JavaFX: JavaFXpert.com
• Meu blog de JavaFX: steveonjava.com




    5   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
        reserved.
O que eu quero que vocês percebam

    1. A JRE com JavaFX permite a execução de
       aplicações graficamente ricas e com ótima
       performance
    2. Desenvolver apps em JavaFX é natural e divertido
    3. Existem ótimos recursos para ajudá-lo a começar
       com JavaFX
    4. Você deve começar a brincar com JavaFX agora!


6   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
    reserved.
1. Introdução ao JavaFX

    •   Trazendo de volta o rich-client Java
    •   Entendendo a história do JavaFX
    •   Obtendo ferramentas e recursos do JavaFX
    •   Desenvolvendo e rodando o Hello EarthRise
    •   Revisando a estrutura do Hello EarthRise




7   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
    reserved.
Trazendo de volta o rich-client Java

• A web, originalmente projetada para
  compartilhamento de recursos de hipertexto
  ligados (ex:HTML) está sendo forçada a se tornar
  uma plataforma para clientes ricos (rich-client)
• A JRE com JavaFX é uma plataforma de rich-client
  muito melhor, permitindo a execução de aplicações
  graficamente ricas e com ótima performance
• Veja a seção JavaFX Can’t Bring Rich-Client
  Java Back by Itself do capítulo 1

   8   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
       reserved.
Entendendo a história do JavaFX

    • A idéia é de Chris Oliver na SeeBeyond, que foi
      adquirida pela Sun
    • Plataforma e linguagem JavaFX Script anunciada
      no JavaOne 2007
    • Oracle implementou JavaFX 2 como uma API para
      Java, anunciada no JavaOne 2010
    • JavaFX 2.1 GA lançado no JavaOne India 2012
          – Windows and OS/X now GA, Linux GA soon
    • Veja a seção A Brief History of JavaFX no
      Capítulo 1
9   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
    reserved.
Obtendo ferramentas e recursos JavaFX

     • Visite oracle.com/javafx e navegue para
       JavaFX 2.1 SDK. Página de download é:
           – http://www.oracle.com/technetwork/java/javafx/downloads

     • Você também pode fazer download do
       NetBeans 7.1 nessa página
     • Siga as instruções do Set Up NetBeans
       IDE With JavaFX
     • Nota: JDK 7u4 já vem com o SDK do
       JavaFX 2.1
10   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Construindo e executando o Hello EarthRise


     • Siga os passos da seção Building and Running the
       Program with NetBeans do Capítulo 1




11   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Demo


12   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Revisão da estrutura do Hello Earthrise

•    Classe da aplicação e o método sobrescrito start()
•    Código declarativo que define a interface do usuário
•    Usando a classe Stage
•    Usando a classe Scente
•    Mostrando imagens
•    Veja a seção Understanding the Hello Earthrise
     Program do capítulo 1

13   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Passo-a-passo no código


 14   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
      reserved.
2. Criando uma interface gráfica em JavaFX


•    Demo da app MetronomeTransition
•    Revisão do código do MetronomeTransition
•    Expressando a interface gráfica de maneira declarativa
•    Fazendo o binding(ligação) de propriedades no modelo
•    Nós de animação




15   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Demo da app MetronomeTransition


                                                                                                                                     • Código do
                                                                                                                                       MetronomeTransition
                                                                                                                                       está na pasta
                                                                                                                                       8727_ch02code do
                                                                                                                                       pacote de download
                                                                                                                                       do Pro JavaFX 2 code




16   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Demo


17   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Revisão do código do MetronomeTransition


     •   Expressando a interface gráfica de maneira declarativa
     •   Usando classes de layout
     •   Fazendo o binding(ligação) de propriedades no modelo
     •   Nós de animação




18   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Passo-a-passo no código


 19   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
      reserved.
3. Usando os controles da JavaFX UI

•    Demo do exemplo StarterApp
•    Examinando o código do StarterApp
•    Visão geral dos componentes de interação da StarterApp
•    Aproveitando os controles de UI em código
•    Associando uma folha de estilos CSS ao JavaFX
•    Definindo as classes do domínio



20   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Demo do exemplo StarterApp




                                                                                                                                     • Código do StarterApp está
                                                                                                                                       na pasta 8727_ch05code
                                                                                                                                       do pacote de download do
                                                                                                                                       Pro JavaFX 2 code




21   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Demo


22   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Examinando o código StarterApp

     •   Visão geral dos componentes de interação da StarterApp
     •   Aproveitando os controles de UI em código
     •   Associando uma folha de estilos CSS ao JavaFX
     •   Definindo as classes do domínio




23   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Passo-a-passo no código


 24   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
      reserved.
4. Usando as classes de Mídia

•    Demo da app VideoPlayer1
•    Examinando o código do VideoPlayer1
•    Usando MediaView, MediaPlayer e classes de Mídia
•    Programação procedural vs. abordagem declarativa




25   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Demo do VideoPlayer1



                                                                                                                                     • Código do
                                                                                                                                       VideoPlayer1 está
                                                                                                                                       na pasta
                                                                                                                                       8727_ch08code
                                                                                                                                       do pacote de
                                                                                                                                       download do Pro
                                                                                                                                       JavaFX 2 code




26   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Passo-a-passo no código


 27   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
      reserved.
Examinando o código do VideoPlayer1

     • Usando MediaView, MediaPlayer e classes de Mídia
     • Programação procedural vs. abordagem declarativa




28   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Passo-a-passo no código


 29   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
      reserved.
5. Usando FXML

     • Demo da app AdoptionForm
     • Examinando a arquitetura do AdoptionForm
     • Ferramenta Scene Builder gera FXML




30   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
The AdoptionForm example app




31   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Demo


32   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
6. Implantando apps JavaFX

     • Algumas opções são Java WebStart e rodar como um
       applet
           – ex. Ícone em uma página conhecida que invoca o TweetBrowser
             no Java WebStart
     • Outra boa opção de implantação é chamar um instalador
           – “Não há aplicação que faça isso”
           – Veja o post relacionado no FXexperience.com




33   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
7. Embutindo HTML5

     • Ver a API WebView
     • Demonstrar o exemplo Java Conference Tour
     • Examinar a arquitetura do Java Conference Tour




34   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Mostrando HTML no JavaFX

     public class WebViewTest extends Application {
        public static void main(String[] args) {
          launch(WebViewTest.class, args);
        }
        @Override public void start(Stage stage) {
          WebView webView = new WebView();
          webView.getEngine().load("http://google.com");
          Scene scene = new Scene(webView);
          stage.setScene(scene);
          stage.setTitle("Web Test");
          stage.show();
     }}


35   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Mostrando HTMLno JavaFX




36   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Chamando Javascript no JavaFX

     String script = "alert('We have got a message, Houston!');”;
     eng.executeScript(script);




37   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Conversão de tipos JavaScript para Java


JavaScript                                                                                                       Java
null                                                                                                             null
undefined                                                                                                        “undefined”
number                                                                                                           java.lang.Number (Integer ou Double)
string                                                                                                           java.lang.String
boolean                                                                                                          java.lang.Boolean
object                                                                                                           netscape.javascript.JSObject



   38   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
        reserved.
Respondendo a eventos de Browser

     • Alert/Confirm/Prompt – Responder para funções de
         interação JavaScript
     • Redimensionamento – Página web se move ou
         redimensiona a janela
     • Status – Página muda o texto de status
     • Visibilidade – Esconder ou mostrar a janela
     • Popup – Gerar uma segunda tela/engine

39   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
A app Java Conference Tour




40   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Demo


41   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
O que vimos nessa apresentação

     1. A JRE com JavaFX permite a execução de
        aplicações graficamente ricas e com ótima
        performance
     2. Desenvolver apps em JavaFX é natural e divertido
     3. Existem ótimos recursos para ajudá-lo a começar
        com JavaFX
     4. Você deve começar a brincar com JavaFX agora!


42   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
Perguntas e Respostas


43   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.
44   Copyright © 2011, Oracle and/or its affiliates. All rights   Insert Information Protection Policy Classification from Slide 8
     reserved.

More Related Content

PPTX
JavaFX 2 - A Java Developer's Guide (San Antonio JUG Version)
PDF
JDK 9 Java Platform Module System
PDF
JDK 10 Java Module System
PDF
JDK versions and OpenJDK
PDF
It's a jdk jungle out there - JDK 11 and OpenJDK 11
PDF
Microservices and Container
PDF
Introduction to JavaFX on Raspberry Pi
PPTX
JavaFX 2 Using the Spring Framework
JavaFX 2 - A Java Developer's Guide (San Antonio JUG Version)
JDK 9 Java Platform Module System
JDK 10 Java Module System
JDK versions and OpenJDK
It's a jdk jungle out there - JDK 11 and OpenJDK 11
Microservices and Container
Introduction to JavaFX on Raspberry Pi
JavaFX 2 Using the Spring Framework

What's hot (20)

PDF
Modules all the way down: OSGi and the Java Platform Module System
PDF
JavaOne2015報告会 in Okinawa
PDF
PDF
Java: Create The Future Keynote
PDF
PPTX
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
PDF
Why should i switch to Java SE 7
PDF
JavaOne Update zur Java Plattform
PDF
Virtual dev-day-java7-keynote-1641807
PPTX
Ed presents JSF 2.2 at a 2013 Gameduell Tech talk
PDF
Antelink Presentation at EOLE 2011, Barcelona, Spain
PPTX
JSF 2.2
PPTX
Comparison between Oracle JDK, Oracle OpenJDK, and Red Hat OpenJDK
PDF
Advanced messaging with Apache ActiveMQ
PDF
JAX-RS 2.0: RESTful Web services on steroids at Geecon 2012
PDF
Websocket 1.0
PPTX
JavaFX and JEE 7
PPT
GlassFish BOF
PPTX
JDK 9, 10, 11 and Beyond
PDF
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
Modules all the way down: OSGi and the Java Platform Module System
JavaOne2015報告会 in Okinawa
Java: Create The Future Keynote
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
Why should i switch to Java SE 7
JavaOne Update zur Java Plattform
Virtual dev-day-java7-keynote-1641807
Ed presents JSF 2.2 at a 2013 Gameduell Tech talk
Antelink Presentation at EOLE 2011, Barcelona, Spain
JSF 2.2
Comparison between Oracle JDK, Oracle OpenJDK, and Red Hat OpenJDK
Advanced messaging with Apache ActiveMQ
JAX-RS 2.0: RESTful Web services on steroids at Geecon 2012
Websocket 1.0
JavaFX and JEE 7
GlassFish BOF
JDK 9, 10, 11 and Beyond
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
Ad

Viewers also liked (6)

PPTX
JavaFX 2.0 and Alternative Languages
PPTX
5 Ways to Get More Leads & Sales - M2Con Digital Marketing Conference
PPTX
Beginning Android Flash Development
PDF
MySQL para Desenvolvedores de Games
PPT
Xml Introduction Practice
PPTX
JavaFX Your Way - Devoxx Version
JavaFX 2.0 and Alternative Languages
5 Ways to Get More Leads & Sales - M2Con Digital Marketing Conference
Beginning Android Flash Development
MySQL para Desenvolvedores de Games
Xml Introduction Practice
JavaFX Your Way - Devoxx Version
Ad

Similar to Return of Rich Client Java - Brazil (20)

PDF
Introduction to Java Micro Edition (ME) 8
PDF
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
PPTX
Introduction To JavaFX 2.0
PDF
Ebs troubleshooting con9019_pdf_9019_0001
PDF
Extensibility in the cloud – power to the business user
PDF
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
PPTX
Jakarta EE: Today and Tomorrow
PPTX
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
PDF
Serverless Java - Challenges and Triumphs
PDF
MicroProfile for MicroServices
PDF
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
PDF
MVC 1.0 / JSR 371
PPTX
Mastering DevOps with Oracle
PPTX
Java 101
PDF
JavaOne 2015: CON 3437 - Smart Devices for the Internet of Things ...
PDF
Владимир Иванов (Oracle): Java: прошлое и будущее
PPT
What's New in WebLogic 12.1.3 and Beyond
PDF
Serverless Java Challenges & Triumphs
PPTX
whats-new-netbeans-ide-80.pptx
PPTX
DesktopApps.pptx
Introduction to Java Micro Edition (ME) 8
Polyglot! A Lightweight Cloud Platform for Java SE, Node, and More
Introduction To JavaFX 2.0
Ebs troubleshooting con9019_pdf_9019_0001
Extensibility in the cloud – power to the business user
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
Jakarta EE: Today and Tomorrow
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
Serverless Java - Challenges and Triumphs
MicroProfile for MicroServices
Java 2012 conference keynote - Java Strategy & Roadmap - WebLogic & GlassFish...
MVC 1.0 / JSR 371
Mastering DevOps with Oracle
Java 101
JavaOne 2015: CON 3437 - Smart Devices for the Internet of Things ...
Владимир Иванов (Oracle): Java: прошлое и будущее
What's New in WebLogic 12.1.3 and Beyond
Serverless Java Challenges & Triumphs
whats-new-netbeans-ide-80.pptx
DesktopApps.pptx

More from Stephen Chin (20)

PPTX
DevOps Tools for Java Developers v2
PPTX
10 Ways Everyone Can Support the Java Community
PPTX
Java Clients and JavaFX: The Definitive Guide
PPTX
DevOps Tools for Java Developers
PPTX
Java Clients and JavaFX - Presented to LJC
PPTX
RetroPi Handheld Raspberry Pi Gaming Console
PPTX
JavaFX on Mobile (by Johan Vos)
PPTX
Confessions of a Former Agile Methodologist (JFrog Edition)
PPTX
Devoxx4Kids Lego Workshop
PPTX
Raspberry Pi with Java (JJUG)
PPTX
Confessions of a Former Agile Methodologist
PPTX
Internet of Things Magic Show
PPTX
Zombie Time - JSR 310 for the Undead
PPTX
JCrete Embedded Java Workshop
PPTX
Oracle IoT Kids Workshop
PPTX
OpenJFX on Android and Devices
PPTX
Java on Raspberry Pi Lab
PDF
Java 8 for Tablets, Pis, and Legos
PDF
DukeScript
PPTX
Devoxx4Kids NAO Workshop
DevOps Tools for Java Developers v2
10 Ways Everyone Can Support the Java Community
Java Clients and JavaFX: The Definitive Guide
DevOps Tools for Java Developers
Java Clients and JavaFX - Presented to LJC
RetroPi Handheld Raspberry Pi Gaming Console
JavaFX on Mobile (by Johan Vos)
Confessions of a Former Agile Methodologist (JFrog Edition)
Devoxx4Kids Lego Workshop
Raspberry Pi with Java (JJUG)
Confessions of a Former Agile Methodologist
Internet of Things Magic Show
Zombie Time - JSR 310 for the Undead
JCrete Embedded Java Workshop
Oracle IoT Kids Workshop
OpenJFX on Android and Devices
Java on Raspberry Pi Lab
Java 8 for Tablets, Pis, and Legos
DukeScript
Devoxx4Kids NAO Workshop

Recently uploaded (20)

PPTX
Chapter 5: Probability Theory and Statistics
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
1. Introduction to Computer Programming.pptx
PDF
Architecture types and enterprise applications.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
Tartificialntelligence_presentation.pptx
Chapter 5: Probability Theory and Statistics
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Univ-Connecticut-ChatGPT-Presentaion.pdf
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
WOOl fibre morphology and structure.pdf for textiles
Programs and apps: productivity, graphics, security and other tools
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Final SEM Unit 1 for mit wpu at pune .pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Getting started with AI Agents and Multi-Agent Systems
1. Introduction to Computer Programming.pptx
Architecture types and enterprise applications.pdf
Enhancing emotion recognition model for a student engagement use case through...
Zenith AI: Advanced Artificial Intelligence
A comparative study of natural language inference in Swahili using monolingua...
Hindi spoken digit analysis for native and non-native speakers
Assigned Numbers - 2025 - Bluetooth® Document
OMC Textile Division Presentation 2021.pptx
Tartificialntelligence_presentation.pptx

Return of Rich Client Java - Brazil

  • 1. 1 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 2. O Retorno do Rich-Client Java Translation By: Apresentado por Stephen Chin Marcelo Quinta @mrquinta 2 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 3. Sobre o palestrante: Stephen Chin • Evangelista Java/JavaFX na Oracle • Autor de vários livros de Java, mais recentemente o Pro JavaFX 2 • Blog: steveonjava.com • Twitter: @steveonjava • stephen.chin@oracle.com 3 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 4. Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 4 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 5. Recursos da apresentação • Visite ProJavaFX2.com para baixar o capítulo 1 e todos os exemplos • Site do JavaFX: oracle.com/javafx • Site do NetBeans: netbeans.org • Blog fxexperience: fxexperience.com • Blog do Jim Weaver sobre JavaFX: JavaFXpert.com • Meu blog de JavaFX: steveonjava.com 5 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 6. O que eu quero que vocês percebam 1. A JRE com JavaFX permite a execução de aplicações graficamente ricas e com ótima performance 2. Desenvolver apps em JavaFX é natural e divertido 3. Existem ótimos recursos para ajudá-lo a começar com JavaFX 4. Você deve começar a brincar com JavaFX agora! 6 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 7. 1. Introdução ao JavaFX • Trazendo de volta o rich-client Java • Entendendo a história do JavaFX • Obtendo ferramentas e recursos do JavaFX • Desenvolvendo e rodando o Hello EarthRise • Revisando a estrutura do Hello EarthRise 7 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 8. Trazendo de volta o rich-client Java • A web, originalmente projetada para compartilhamento de recursos de hipertexto ligados (ex:HTML) está sendo forçada a se tornar uma plataforma para clientes ricos (rich-client) • A JRE com JavaFX é uma plataforma de rich-client muito melhor, permitindo a execução de aplicações graficamente ricas e com ótima performance • Veja a seção JavaFX Can’t Bring Rich-Client Java Back by Itself do capítulo 1 8 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 9. Entendendo a história do JavaFX • A idéia é de Chris Oliver na SeeBeyond, que foi adquirida pela Sun • Plataforma e linguagem JavaFX Script anunciada no JavaOne 2007 • Oracle implementou JavaFX 2 como uma API para Java, anunciada no JavaOne 2010 • JavaFX 2.1 GA lançado no JavaOne India 2012 – Windows and OS/X now GA, Linux GA soon • Veja a seção A Brief History of JavaFX no Capítulo 1 9 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 10. Obtendo ferramentas e recursos JavaFX • Visite oracle.com/javafx e navegue para JavaFX 2.1 SDK. Página de download é: – http://www.oracle.com/technetwork/java/javafx/downloads • Você também pode fazer download do NetBeans 7.1 nessa página • Siga as instruções do Set Up NetBeans IDE With JavaFX • Nota: JDK 7u4 já vem com o SDK do JavaFX 2.1 10 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 11. Construindo e executando o Hello EarthRise • Siga os passos da seção Building and Running the Program with NetBeans do Capítulo 1 11 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 12. Demo 12 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 13. Revisão da estrutura do Hello Earthrise • Classe da aplicação e o método sobrescrito start() • Código declarativo que define a interface do usuário • Usando a classe Stage • Usando a classe Scente • Mostrando imagens • Veja a seção Understanding the Hello Earthrise Program do capítulo 1 13 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 14. Passo-a-passo no código 14 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 15. 2. Criando uma interface gráfica em JavaFX • Demo da app MetronomeTransition • Revisão do código do MetronomeTransition • Expressando a interface gráfica de maneira declarativa • Fazendo o binding(ligação) de propriedades no modelo • Nós de animação 15 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 16. Demo da app MetronomeTransition • Código do MetronomeTransition está na pasta 8727_ch02code do pacote de download do Pro JavaFX 2 code 16 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 17. Demo 17 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 18. Revisão do código do MetronomeTransition • Expressando a interface gráfica de maneira declarativa • Usando classes de layout • Fazendo o binding(ligação) de propriedades no modelo • Nós de animação 18 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 19. Passo-a-passo no código 19 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 20. 3. Usando os controles da JavaFX UI • Demo do exemplo StarterApp • Examinando o código do StarterApp • Visão geral dos componentes de interação da StarterApp • Aproveitando os controles de UI em código • Associando uma folha de estilos CSS ao JavaFX • Definindo as classes do domínio 20 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 21. Demo do exemplo StarterApp • Código do StarterApp está na pasta 8727_ch05code do pacote de download do Pro JavaFX 2 code 21 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 22. Demo 22 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 23. Examinando o código StarterApp • Visão geral dos componentes de interação da StarterApp • Aproveitando os controles de UI em código • Associando uma folha de estilos CSS ao JavaFX • Definindo as classes do domínio 23 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 24. Passo-a-passo no código 24 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 25. 4. Usando as classes de Mídia • Demo da app VideoPlayer1 • Examinando o código do VideoPlayer1 • Usando MediaView, MediaPlayer e classes de Mídia • Programação procedural vs. abordagem declarativa 25 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 26. Demo do VideoPlayer1 • Código do VideoPlayer1 está na pasta 8727_ch08code do pacote de download do Pro JavaFX 2 code 26 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 27. Passo-a-passo no código 27 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 28. Examinando o código do VideoPlayer1 • Usando MediaView, MediaPlayer e classes de Mídia • Programação procedural vs. abordagem declarativa 28 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 29. Passo-a-passo no código 29 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 30. 5. Usando FXML • Demo da app AdoptionForm • Examinando a arquitetura do AdoptionForm • Ferramenta Scene Builder gera FXML 30 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 31. The AdoptionForm example app 31 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 32. Demo 32 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 33. 6. Implantando apps JavaFX • Algumas opções são Java WebStart e rodar como um applet – ex. Ícone em uma página conhecida que invoca o TweetBrowser no Java WebStart • Outra boa opção de implantação é chamar um instalador – “Não há aplicação que faça isso” – Veja o post relacionado no FXexperience.com 33 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 34. 7. Embutindo HTML5 • Ver a API WebView • Demonstrar o exemplo Java Conference Tour • Examinar a arquitetura do Java Conference Tour 34 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 35. Mostrando HTML no JavaFX public class WebViewTest extends Application { public static void main(String[] args) { launch(WebViewTest.class, args); } @Override public void start(Stage stage) { WebView webView = new WebView(); webView.getEngine().load("http://google.com"); Scene scene = new Scene(webView); stage.setScene(scene); stage.setTitle("Web Test"); stage.show(); }} 35 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 36. Mostrando HTMLno JavaFX 36 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 37. Chamando Javascript no JavaFX String script = "alert('We have got a message, Houston!');”; eng.executeScript(script); 37 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 38. Conversão de tipos JavaScript para Java JavaScript Java null null undefined “undefined” number java.lang.Number (Integer ou Double) string java.lang.String boolean java.lang.Boolean object netscape.javascript.JSObject 38 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 39. Respondendo a eventos de Browser • Alert/Confirm/Prompt – Responder para funções de interação JavaScript • Redimensionamento – Página web se move ou redimensiona a janela • Status – Página muda o texto de status • Visibilidade – Esconder ou mostrar a janela • Popup – Gerar uma segunda tela/engine 39 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 40. A app Java Conference Tour 40 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 41. Demo 41 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 42. O que vimos nessa apresentação 1. A JRE com JavaFX permite a execução de aplicações graficamente ricas e com ótima performance 2. Desenvolver apps em JavaFX é natural e divertido 3. Existem ótimos recursos para ajudá-lo a começar com JavaFX 4. Você deve começar a brincar com JavaFX agora! 42 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 43. Perguntas e Respostas 43 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.
  • 44. 44 Copyright © 2011, Oracle and/or its affiliates. All rights Insert Information Protection Policy Classification from Slide 8 reserved.

Editor's Notes

  • #4: Oracle Java/JavaFX EvangelistAuthored several Java books, most recently Pro JavaFX 2Blog: steveonjava.comTwitter: @steveonjavastephen.chin@oracle.com
  • #6: Visit ProJavaFX2.com to download Chapter 1 and all code examplesJavaFX site: oracle.com/javafxNetBeans site: netbeans.orgfxexperience blog: fxexperience.comJim Weaver’s JavaFX blog: JavaFXpert.comMy JavaFX blog: steveonjava.com
  • #7: The JRE with JavaFX enables graphically rich, fast performing applications Developing JavaFX apps is natural and funLots of great resources exist to help you get started with JavaFXYou should begin playing with JavaFX now!
  • #8: Bringing back rich-client JavaLearning the history of JavaFXObtaining JavaFX tools and resourcesBuilding and running Hello EarthRiseReviewing the structure of Hello EarthRise
  • #9: The web, originally intended for sharing hypertext-linked resources, has been force-fit into being a rich-client platformThe JRE with JavaFX is a much better client platform, enabling graphically rich, fast performing applications See Chapter 1 JavaFX Can’t Bring Rich-Client Java Back by Itself section