SlideShare uma empresa Scribd logo
1 de 85
Baixar para ler offline
Real World
Technologies:
NetBeans GUI Builder,
JRuby, JavaFX, and
Java ME

developers.sun.com/students/courses



                                      1
Topics
• Introduction to “Real World Technologies: NetBeans
  GUI Builder, JRuby, JavaFX, and Java ME – Earn a
  Certificate” 5-hour online course
• NetBeans GUI Builder
• JRuby & JRuby on Rails
• Java FX Programming
• Java ME Programming



                                                   2
Real World Technologies 5-hour
Online Course
• You can take it anytime – it is free!
• http://developers.sun.com/students/courses
• You get exposed to exciting and leading-edge real-
  life technologies
• You do the hands-on lab and homework
• If you submit all 4 homeworks, you will receive PDF
  version of certificate
• You can participate in the course forum
                                                        3
NetBeans GUI
Builder



               4
NetBeans GUI Builder (Matisse)
• Issues with building GUI without Matisse
  >   Complexity with Swing APIs
  >   Resizing and Alignment are hard
  >   Locale handling
  >   Behave differently over different OS platforms
• Matisse handles all these for you!
  > Guidelines provided at design time to help with placing and
    sizing controls
  > Adjustments made at runtime for user's look & feel and locale



                                                                  5
Free Design
• You can build your forms by simply putting
  components where you want them as though you
  were using absolute positioning
• The GUI Builder figures out which layout attributes
  are required and then generates the code for you
  automatically.
  > You need not concern yourself with insets, anchors, fills, and
    so forth.



                                                                     6
Automatic Component Positioning
• As you add components to a form, the GUI Builder
  provides visual feedback that assists in positioning
  components based on your operating system's look
  and feel.
• The GUI Builder provides helpful inline hints and
  other visual feedback regarding where components
  should be placed on your form, automatically
  snapping components into position along
  guidelines.

                                                         7
Visual Feedback
• The GUI Builder also provides visual feedback
  regarding component anchoring and chaining
  relationships.
• These indicators enable you to quickly identify the
  various positioning relationships and component
  pinning behavior that affect the way your GUI will
  both appear and behave at runtime.
  > This speeds the GUI design process, enabling you to
    quickly create professional-looking visual interfaces that
    work.
                                                                 8
NetBeans GUI Builder
Demo: These Are The
Exercises You Will Do
as Part of the Course
Demo 1: Building a Contact Editor




                                    10
Demo 2: Adding Event Handlers




                                11
JRuby &
JRuby on Rails



                 12
Topics
•   What is and Why JRuby?
•   What is “JRuby on Rails”?
•   “Ruby on Rails” Principles
•   Why “Ruby on Rails”?
•   Why “JRuby on Rails”?




                                 13
What is and Why JRuby?
Open source
        Java
implementation of the
        Ruby
      language
                        15
What Is JRuby?
•   Started in 2002
•   Java platform implementation of Ruby language
•   Open source, many active contributors
•   Aiming for compatibility with current Ruby version
•   Integrates with Java technology
    > Call to Ruby from Java technology via Java Specification
      Request (JSR) 223, BSF, Spring
    > Use Java class files from Ruby (e.g., Script Java)
• Growing set of external projects based on JRuby
    > JRuby-extras (GoldSpike, ActiveRecord-JDBC,…)
                                                             16
JRuby: Java Technology Integration
• Script Java
  > Power of Java technology with the Syntax of Ruby


      require 'java'

      list   = java.util.ArrayList.new
      list   << 1
      list   << 3
      list   << 2

      list.sort



                                                       17
Why JRuby?
• JRuby over Ruby
  >   Strong likelihood we will be faster soon
  >   Better scalability with native threading
  >   Native unicode support
  >   Compilation
  >   Integration with Java libraries
  >   Easier path to getting Ruby in the enterprise
• JRuby over Java technology
  > Language features
       > Blocks, modules, metaprogramming, dynamic-typing
  > Ruby applications/libraries
       > Rails, Rspec, Rake, Raven, other R’s


                                                            18
What is “JRuby on Rails”?
What Is “Ruby on Rails”?
• A full-stack MVC web development framework
• Open source (MIT), many contributors
• Written in Ruby
• First released in 2004 by
  David Heinemeier Hansson
• Gaining popularity
    > Ruby and Rails book sales are outselling
      Perl book sales


                                                 20
“Ruby on Rails”
Principles
“Ruby on Rails” Principles
• Convention over configuration
  > Why punish the common cases?
  > Encourages standard practices
  > Everything simpler and smaller
• Don’t Repeat Yourself (DRY)
  > Framework written around minimizing repetition
  > Repetitive code harmful to adaptability
• Agile development environment
  > No recompile, deploy, restart cycles
  > Simple tools to generate code quickly
  > Testing built into the framework                 22
Why “Ruby on Rails”?
• Greatly simplified web development
  > Instant applications: working code in minutes
  > “Less Rails code than Java application configuration”
• Growing community of developers
• Makes small apps trivial to create
• Ruby is an excellent language




                                                            23
Why “JRuby on Rails”
over “Ruby on Rails”?
• Deployment to Java application servers
• Java technology production environments pervasive
  > Easier to switch framework vs. whole architecture
  > Lower barrier to entry
• Broader, more scalable database support
• Integration with Java technology libraries,
  legacy services
• No need to leave Java technology servers, libraries,
  reliability
                                                         24
“JRuby on Rails”: Java EE Platform
• Pool database connections
• Access any Java Naming and Directory Interface™
  (J.N.D.I.) API resource
• Access any Java EE platform TLA:
  >   Java Persistence API (JPA)
  >   Java Management Extensions (JMX™)
  >   Enterprise JavaBeans™ (EJB™)
  >   Java Message Service (JMS) API
  >   SOAP/WSDL/SOA


                                                    25
“JRuby on Rails”: Deployment
Platforms
• Mongrel
  > Built-in container
• Warfile deployment to:
  > GlassFish™ V2
  > GlassFish™ V3
  > Servlet-based app server




                               26
JRuby on Rails: Futures
• Improve Java EE platform support for Rails
  > Rubify Java EE platform APIs
  > Create Rails plug-ins to make installable units
• Use Java technology native equivalents
  > Unicode support
  > XML support
• Port Ruby native libraries
  > RMagick



                                                      27
JRuby on Rails
Demo: These Are The
Exercises You Will Do
as Part of the Course
Demo 1: Building WebLog Webapp




                                 29
Demo 2: Building Flickr Webapp




                                 30
JavaFX
Programming



              31
Topics
•   What is and Why JavaFX?
•   JavaFX Product family and Architecture
•   JavaFX Script
•   JavaFX Script examples




                                             32
What is and Why
JavaFX?




                  33
Market Trends
• Personal & mobile computing are blurring
  > Handsets becoming more advanced
  > Higher-speed IP Networks
• Ecosystem shifting to “platforms”
  > Full application environment including middleware, user
    experience, etc.
  > Reduce development costs and improves device
    consistency
• Software stacks largely proprietary
  > Industry looking for an Open alternative

                                                              34
The GUI Quagmire
• Java Swing and 2D APIs are very powerful and yet
  > Why does it take a long time to write GUI programs?
  > How can we avoid the “Ugly Java technology GUI”
    stereotype?
  > Why do Flash programs look different than Java
    programs?
  > Why does it seem easier to write web apps than Swing
    programs?
  > How can I avoid having an enormous mass of listener
    patterns?

                                                           35
Why yet another scriting language
for Java, JavaFX Script?
• Language for Spicying up Java GUI Programing
  easier
• Building and running of media/content- rich Java
  clients application much easier
• More productive by making Swing and Java 2D™
  API accessible to a much the script programmer
• Simple Accessing of Java Objects
• Serve as persistence format for a new class of tools
  targeted at non programmers like designers and
  end users
                                                         36
Expanding the Community
                                Professionals
    Programming (Java) skills




                                                Community size
                                    Java
                                 developers

                                   Script
                                programmers

                                   Visual
                                  designers

                                  Hobbyist
                                                                 37
JavaFX
Product Family &
Architecture



                   38
JavaFX Product Family
• Announced at JavaONE 2007
• Leverages the Java platform's write-once-run-
  anywhere portability, application security model,
  ubiquitous distribution and enterprise connectivity
• Initially comprised of:
  JavaFX Script
     > Highly productive scripting language for content developers to
       create rich media and interactive content
  JavaFX Mobile
     > Mobile software stack available via OEM license to carriers and
       handset manufacturers seeking a branded relationship with
       consumers
                                                                        39
JavaFX: An Architecture that Scales
 The Big
 Picture
              Home          JavaFX
 Devices                               Desktop




                                                               Content Authoring Tools
           Entertainment     Mobile

                                                 Interactive




                                                                    JavaFX Script
                                                   Content

                                                   JavaFX
                                                 Framework
                                      2D/3D
                           AGUI
           PBP
SVG/MSA

CLDC       CDC             CDC        SE
                                                                          40
JavaFX Workflow
Visual                   Content developer
                                                                                           Java FX Mobile
Designer
                                                                                             App Binary

                                                                                       JavaFX Mobile




                                                                        g
                                                                      in
                                                                    ag
                                                                  ck
                                                                             Java FX TV
                          JavaFX Script code




                                                                Pa
                                                                              App Binary
       Visu




                                                                    ng
                                                              ck agi          JavaFX TV
                                                            Pa
           al A
               sse




                                                       n
                  ts




                                                    tio

                                                           Pa
                                                  la
                                                  pi



                                                             ck
                                                 m




                                                               ag
                                               Co




                       Java FX Source                            ing
                         Application
                                                                         Java FX Desktop
                                                                            App Binary
                  JavaFX Tools
                                                                          JavaFX Desktop
                                                                          / Consumer JRE


                                                                                                            41
What is
JavaFX Script?




                 42
What is JavaFX Script?
• Formerly known as F3 (Form Follows Function) of
  Chirstopher Oliver from Sun Microsystems
  > http://blogs.sun.com/chrisoliver/category/JavaFX
• Java Scripting Language
  >   Object-oriented
  >   Static typing + type inference
  >   Declarative Syntax
  >   Automatic Data Binding
  >   Mixed functional/procedural evaluation model


                                                       43
What is JavaFX Script?
• Extensive widget library encompassing Swing
  components and Java2D objects
• Easily create and configure individual components
• Work with all major IDEs
• Statically typed - retains same code structuring,
  reuse, and encapsulation features of Java
• Capable of supporting GUIs of any size or
  complexity
• Makes it easier to use Swing
• Rich Internet Applications (RIA)
                                                      44
JavaFX Script – A Simple Comparison
In JavaFX Script                                      In Java
                                                        Main guitar class 
     picks.opacity = [0, .01 .. 1 ] dur 1000 linear
                                                               guitarAnimationThread = new StringOpThread();
                                                               ......
                                                               ......
                                                               if (guitarAnimationThread != null) {
                                                                  guitarAnimationThread.run();
                                                               }
 In Java                                                       .........

 (SwingLabs Timing                                      StringOpThread class
                                                               ...........
 Framework)                                                 public void run() {
  public void class Guitar {                                       opacityBegin = 0.01;
                                                               opacityEnd = 1.0;
      private GuitarPick pick = ...;                               opacityIncreStep = 0.02;
      public Guitar() {                                            opacitySleep = 2;
          pick.setOpacity(.5f);
                                                                for(currOpacity = opacityBegin; 
          Animator a =
                                                                      currOpacity < opacityEnd;   
               PropertySetter.createAnimator(                           currOpacity+=opacityIncreStep) {
                  300, pick, quot;opacityquot;, .5f, 1.0f);               setPickOpacity();
                                                                  repaint();
          MouseTrigger.addTrigger(pick, a,
                                                                  try {
                  MouseTriggerEvent.ENTER, true);                   thread.sleep(opacitySleep);
      }                                                           } catch (InterruptedException e) { }
  }
                                                                                                               45
JavaFX Script Examples:
Hello World

                          46
Example : Hello world in Java FX

import javafx.ui.*;


Frame {
    title: quot;Hello World JavaFXquot;
    width: 200
    height: 50
    content: Label {
        text: quot;Hello Worldquot;
    }
    visible: true
}
                                   47
Example : Hello world in Swing
import javax.swing.*;


public class HelloWorldSwing {
  public static void main(String[] args) {
      JFrame frame = new Jframe(quot;HelloWorld Swingquot;);
      final JLabel label = new JLabel(quot;Hello Worldquot;);
      frame.getContentPane().add(label);


      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.pack();
      frame.setVisible(true);
  }
                                                              48
Data Binding




               49
Data Binding in JavaFX
• Cause and Effect—Responding to change
• The JavaFX bind operator—Allows dynamic content to be
  expressed declaratively
• Dependency-based evaluation of any expression
• Automated by the system—Rather than manually wired
  by the programmer
• You just declare dependencies and the JavaFX runtime
  takes care of performing updates when things change
• Eliminates listener patterns


                                                      50
Example: Dynamic Behavior
class HelloWorldModel {
     attribute saying: String;
}
var model = HelloWorldModel {
     saying: quot;Hello Worldquot;
};
var win = Frame {
    title: bind quot;{model.saying} JavaFXquot;
    width: 200
    content: TextField {
        value: bind model.saying
    }
    visible: true
};

                                          51
Java 2D




          52
Java 2D API
• To match the designs of UI designers requires using Java
  2D API
• But Java 2D API doesn’t have compositional behavior
   > The barrier to entry for many Java code programmers is
     too high (i.e., other than Romain Guy)
• In addition to Swing Components, JavaFX includes SVG-
  like interfaces to Java 2D API as first-class elements which
  can be composed together into higher-level components
• JavaFX allows declarative expression of this composition



                                                                 53
Java ME
Programming



              54
Topics
•   What is and Why Java ME?
•   Java ME architecture
•   NetBeans Mobility Pack Features
•   Game development




                                      55
What is and Why
Java ME?




                  56
Why Develop Mobility Applications?

• “Application at your fingertips”
• Personal
  > One of 4 things you always carry with you (keys, wallet,
     watch, handphone)
• Powerful, feature rich, programmable and royalty free
  > Games in particular
• Anyone commuting will have 30mins to kill
  > Capture audience
• It's not really that difficult
                                                               57
The Java™ Platforms



Java Technology   Java Technology   Workgroup   High-End
Enabled Devices   Enabled Desktop    Server      Server




                                                      58
Java on Mobile Devices




     Mobile Service Architecture (MSA) provides
a complete platform for mobile application development
                                                         59
Java ME Application Market

                             $3B




   $3 Billion Java
 Mobile Game Market
                                   60
Java ME
Architecture




               61
Java Platforms

 Optional
Packages
                                   Java Platform,
              Optional
                               Micro Edition (Java ME)
             Packages
                          Optional Packages
                          Personal Advanced
                           Profile       GUI
   Java                     (PP)       (AGUI)
                                                Optional Packages
 Platform,      Java      PersonalBasis Profile
                                  (PBP)
Enterprise    Platform,                             JTWI/MSA
                                                       Mobile
                          Foundation Profile (FP)
  Edition     Standard                                Information
                                                     Device Profile
(Java EE)      Edition      Connected                   (MIDP)
                                           Connected
             (Java SE)       Device
                                         Limited Device
                           Configuration                              Java
                                          Configuration
                              (CDC)                                   Card
                                            (CLDC)
                                                                             62
Java ME CLDC Stack
• Connected Limited Device Configuration (CLDC)
  > For devices with limited memory and processing power
  > KVM (Kilo VM) Virtual Machine especially designed for
    devices with limited computing power and resources
• Mobile Information Device Profile (MIDP)
  > Defines application model, OTA (over-the-air)
    installation, basic UI model and widgets, media
    capabilities, basic Game API, RMS (record management
    system), connectivity, security model


                                                            63
Java ME CLDC Stack (2)
• Multitude of optional JSRs: Media, Bluetooth,
  Messaging, Location, SIP, and many more
• More JSRs are in the pipeline
• “Umbrella” JSRs
  > Define a complete platform from existing JSRs
• Example
  > JSR 185 (Java Technology for Wireless Industry/JTWI)
  > JSR 248 (Mobile Services Architecture/MSA)

                                                           64
Java ME Evolution in Wireless
MIDP → JTWI → MSA (Mobile Service Architecture)

                                         We are here

                                               MSA
                                               CDC
                                               (2007-08)
 Capability




                                MSA
  Device




                                CLDC
                       JTWI     (2006)

                       CLDC
              MIDP     (2003)
              CLDC
              (2001)




                                                           65
Compelling Feature Phone Platform:
MSA (JSR 248)
 Comms        Graphics          Security & Application  Personal
                                Commerce Connectivity Information
  JSR 82        JSR 226
  Bluetooth    2D Scalable
              Vector Graphics

  JSR 180       JSR 184
    SIP        3D Graphics

  JSR 205       JSR 234          JSR 229          JSR 211           JSR 179
    MMS        Mobile-media                        Content
                                  Payment                            Location
  Messaging    Supplement                          Handler

  JSR 120       JSR 135          JSR 177          JSR 172            JSR 75
    SMS                           Security &
               Mobile Media                      Web Services        PIM & File
  Messaging                     Trust Services


Application     JSR 185          JSR 118          JSR 238
                   JTWI           MIDP 2.0          I18N
Environment

Virtual                          JSR 139                        Conditional APIs
Machine                           CLDC 1.1
                                                                JTWI APIs
                                                                                   66
NetBeans Mobility
Pack




                    67
Mobility Pack
             A full IDE built around Sun JavaTM
             Wireless Toolkit
●   Open,                                         ●   Java ME
    integrated                    I
                                  D                   Platform
    development
    environment                   E                   emulation
●   Build, test,                       SD         ●   Device
    deploy rich                        K              agnostic
    applications                                  ●   Provides
●   Accelerate                                        additional
    application                                       utilities for
    time-to-                                          application
    market
                                                      support
●   Visual, drag-   ●   Over 2,000,000 combined
    n-drop              downloads
    authoring       ●   Industry voted awards                   68
Visual Designer




                  69
SVG
• SVG = Scalable Vector Graphics
• Automatically adjusts to screen size
• Two roles
  > Graphical designers create images
  > Developers add business logic
• Visual designer for SVG
  > SVG Menu, SVG Splash Screen, SVG Wait Screen,
    SVG Image, ...


                                                    70
NetBeans 6.0 Mobility New Feature
• New game builder
  > Easier to create mobile games with the Mobility Pack's
    visual editing support for the MIDP 2.0 Game API
  > API supports animated sprites and the ability to arrange
    tiled layers into scenes
• New Integrated UI for CLDC/MIDP and CDC
  development
• New Visual Mobile Designer
• Design analysis
• New components for Flow Control
                                                               71
Game Development




                   72
Development of Java
Technology-Based Games
         • JSR 184 (3D Graphics)
           • 3D world creation and manipulation
         • JSR 135 (Mobile Media)
           • Sounds
         • JSR 82 (Bluetooth)
           • P2P gaming
         • JSR 180 (SIP)
           • P2P over the network
         • JSR 229 (Payment)
           • Payment of new levels
                                             73
Examples of 2D Games




                       74
Core Game API Class Hierarchy




                                75
Game Canvas
• GameCanvas specifically for developing game
  display
  > Class extends GameCanvas to use it
• Subclass of Canvas but provides the following
  improvements
  >   Off-screen buffering
  >   Keypad polling
  >   Access to Graphics object
  >   Do not need to override paint(Graphics) method
• Behavior can be set to be backward compatible with
  Canvas
                                                       76
GameCanvas Example –
Main Game Loop
01 //main game loop
02 while (true) {
03        //Poll key press
04        int key = getK eyStates();
05        if ((key & G ameC anvas.L EFT_PR ESSED) != 0) {
06              //update game objects
07        }
08        if ((key & G ameC anvas.UP_PR ESSED) != 0) {
09              //update game objects
10        }
11        //Get off-screen graphics object
12        G raphics g = getG raphics();
13        //update game screen
14        ...
15        //update the 'dirty' portion to the screen
16        flushG raphics(x, y, dirtyW idth, dirtyHeight);
17 }
                                                            77
Elements in a Game
Background          Sprite
                             • Background
                               > Composable from basic
                                 elements
                               > Static and animated objects
                             • Background layers
                               > Different layers
                               > Layer management
                             • Sprites
                               > Transformation
                               > Collision detection
         Viewport                                        78
Creating a TiledLayer
       tileHeight




                    TiledLayer background = new TiledLayer(
                          50, 50, image, tileWidth,
                    tileHeight)

tileWidth




                                                              79
Creating the Background


 5 5 5 5 5 5 5 5   5 5 5 5




        // Draw the water
        for (int x = 0; x < 12; x++)
          background.setCell(x, y, 5);

                                Tile index
                                             80
Creating Animated Tile




//Indicate the tile to be animated
int animatedTile = backgroud.createAnimatedTile(5);




//Switch the animated tile
backgroud.setAnimateTile(animatedTile, 6);
                                                      81
Creating Sprites
Loading is similar to TiledLayer




                      Calling nextFrame() will
                      display the next frame
                                                 82
Changing the Frame Sequence


               sprite.setFrameSequence
               (new int[]
                  {0, 1, 2, ... 1, 1});

               sprite.nextFrame();




                                      83
Reference Pixel on Sprites

     Default
 reference pixel
     at (0, 0)




                             84
Real World
Technologies:
NetBeans GUI Builder,
JRuby, JavaFX, and
Java ME


                        85

Mais conteúdo relacionado

Mais procurados

itft-Java evolution
itft-Java evolutionitft-Java evolution
itft-Java evolutionAtul Sehdev
 
Eclipse vs Netbean vs Railo
Eclipse vs Netbean vs RailoEclipse vs Netbean vs Railo
Eclipse vs Netbean vs RailoMohd Safian
 
Building RIA Applications with JavaFX
Building RIA Applications with JavaFXBuilding RIA Applications with JavaFX
Building RIA Applications with JavaFXMax Katz
 
[English version] JavaFX and Web Integration
[English version] JavaFX and Web Integration[English version] JavaFX and Web Integration
[English version] JavaFX and Web IntegrationKazuchika Sekiya
 
Go - A Key Language in Enterprise Application Development?
Go - A Key Language in Enterprise Application Development?Go - A Key Language in Enterprise Application Development?
Go - A Key Language in Enterprise Application Development?C4Media
 
What's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xWhat's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xGeertjan Wielenga
 
Rich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentationRich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentationNicko Borodachuk
 
Netbeans65 Osum Slides
Netbeans65 Osum SlidesNetbeans65 Osum Slides
Netbeans65 Osum SlidesAbhishek Gupta
 
Modern web application development with java ee 7
Modern web application development with java ee 7Modern web application development with java ee 7
Modern web application development with java ee 7Shekhar Gulati
 
Lesson 2 introduction in computing
Lesson 2 introduction in computingLesson 2 introduction in computing
Lesson 2 introduction in computingProfessor Thor
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaEdureka!
 
JavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed TamanJavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed TamanJavaDayUA
 
Features of java unit 1
Features of java unit 1Features of java unit 1
Features of java unit 1RubaNagarajan
 

Mais procurados (20)

Netbeans gui tutorial
Netbeans gui tutorialNetbeans gui tutorial
Netbeans gui tutorial
 
itft-Java evolution
itft-Java evolutionitft-Java evolution
itft-Java evolution
 
Eclipse vs Netbean vs Railo
Eclipse vs Netbean vs RailoEclipse vs Netbean vs Railo
Eclipse vs Netbean vs Railo
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
Java Framework comparison
Java Framework comparisonJava Framework comparison
Java Framework comparison
 
Introduction To JavaFX 2.0
Introduction To JavaFX 2.0Introduction To JavaFX 2.0
Introduction To JavaFX 2.0
 
Building RIA Applications with JavaFX
Building RIA Applications with JavaFXBuilding RIA Applications with JavaFX
Building RIA Applications with JavaFX
 
Netbeans IDE & Platform
Netbeans IDE & PlatformNetbeans IDE & Platform
Netbeans IDE & Platform
 
JavaFX
JavaFXJavaFX
JavaFX
 
VisionX Prototyping.
VisionX Prototyping.VisionX Prototyping.
VisionX Prototyping.
 
[English version] JavaFX and Web Integration
[English version] JavaFX and Web Integration[English version] JavaFX and Web Integration
[English version] JavaFX and Web Integration
 
Go - A Key Language in Enterprise Application Development?
Go - A Key Language in Enterprise Application Development?Go - A Key Language in Enterprise Application Development?
Go - A Key Language in Enterprise Application Development?
 
What's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xWhat's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.x
 
Rich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentationRich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentation
 
Netbeans65 Osum Slides
Netbeans65 Osum SlidesNetbeans65 Osum Slides
Netbeans65 Osum Slides
 
Modern web application development with java ee 7
Modern web application development with java ee 7Modern web application development with java ee 7
Modern web application development with java ee 7
 
Lesson 2 introduction in computing
Lesson 2 introduction in computingLesson 2 introduction in computing
Lesson 2 introduction in computing
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
JavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed TamanJavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed Taman
 
Features of java unit 1
Features of java unit 1Features of java unit 1
Features of java unit 1
 

Semelhante a Real World Technologies

Java keynote preso
Java keynote presoJava keynote preso
Java keynote presoArtur Alves
 
Ruby on rails探索
Ruby on rails探索Ruby on rails探索
Ruby on rails探索Mu Chun Wang
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09Michael Neale
 
Accelerate Your Business and Aim for the Cloud with Java and JRuby
Accelerate Your Business and Aim for the Cloud with Java and JRubyAccelerate Your Business and Aim for the Cloud with Java and JRuby
Accelerate Your Business and Aim for the Cloud with Java and JRubyJacob Lehrbaum
 
Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?NIIT India
 
Project report for final year project
Project report for final year projectProject report for final year project
Project report for final year projectsuneel singh
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Shaer Hassan
 
Node.js vs. java which one should you choose for backend development
Node.js vs. java  which one should you choose for backend development Node.js vs. java  which one should you choose for backend development
Node.js vs. java which one should you choose for backend development Moon Technolabs Pvt. Ltd.
 
Busy developer-html5-javaee7
Busy developer-html5-javaee7Busy developer-html5-javaee7
Busy developer-html5-javaee7Geertjan Wielenga
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projectsjazzman1980
 
whats-new-netbeans-ide-7x.pptx
whats-new-netbeans-ide-7x.pptxwhats-new-netbeans-ide-7x.pptx
whats-new-netbeans-ide-7x.pptxGabrielSoche
 

Semelhante a Real World Technologies (20)

Java keynote preso
Java keynote presoJava keynote preso
Java keynote preso
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
 
Ruby on rails探索
Ruby on rails探索Ruby on rails探索
Ruby on rails探索
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09
 
L R U G - JRuby
L R U G - JRubyL R U G - JRuby
L R U G - JRuby
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
JavaFx
JavaFxJavaFx
JavaFx
 
Accelerate Your Business and Aim for the Cloud with Java and JRuby
Accelerate Your Business and Aim for the Cloud with Java and JRubyAccelerate Your Business and Aim for the Cloud with Java and JRuby
Accelerate Your Business and Aim for the Cloud with Java and JRuby
 
Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?
 
Desktop Intro
Desktop IntroDesktop Intro
Desktop Intro
 
Project report for final year project
Project report for final year projectProject report for final year project
Project report for final year project
 
1.Intro--Why Java.pptx
1.Intro--Why Java.pptx1.Intro--Why Java.pptx
1.Intro--Why Java.pptx
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09
 
Ajax World West
Ajax World WestAjax World West
Ajax World West
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Node.js vs. java which one should you choose for backend development
Node.js vs. java  which one should you choose for backend development Node.js vs. java  which one should you choose for backend development
Node.js vs. java which one should you choose for backend development
 
Busy developer-html5-javaee7
Busy developer-html5-javaee7Busy developer-html5-javaee7
Busy developer-html5-javaee7
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projects
 
whats-new-netbeans-ide-7x.pptx
whats-new-netbeans-ide-7x.pptxwhats-new-netbeans-ide-7x.pptx
whats-new-netbeans-ide-7x.pptx
 

Mais de José Maria Silveira Neto

Mais de José Maria Silveira Neto (20)

Android - visão geral
Android - visão geralAndroid - visão geral
Android - visão geral
 
Pixelart
PixelartPixelart
Pixelart
 
Tomorrow Java
Tomorrow JavaTomorrow Java
Tomorrow Java
 
JavaFX Primeiros Passos
JavaFX Primeiros PassosJavaFX Primeiros Passos
JavaFX Primeiros Passos
 
Desenvolvimento de Aplicações
Desenvolvimento de AplicaçõesDesenvolvimento de Aplicações
Desenvolvimento de Aplicações
 
Apresentando o CEJUG e o poder do Java
Apresentando o CEJUG e o poder do JavaApresentando o CEJUG e o poder do Java
Apresentando o CEJUG e o poder do Java
 
Let's talk about Certifications
Let's talk about CertificationsLet's talk about Certifications
Let's talk about Certifications
 
JavaFX Overview
JavaFX OverviewJavaFX Overview
JavaFX Overview
 
NetBeans: a IDE que você precisa
NetBeans: a IDE que você precisaNetBeans: a IDE que você precisa
NetBeans: a IDE que você precisa
 
OpenSolaris a Céu Aberto
OpenSolaris a Céu AbertoOpenSolaris a Céu Aberto
OpenSolaris a Céu Aberto
 
JavaFX introduction
JavaFX introductionJavaFX introduction
JavaFX introduction
 
Database Technologies for Semantic Web
Database Technologies for Semantic WebDatabase Technologies for Semantic Web
Database Technologies for Semantic Web
 
High-Performance Computing and OpenSolaris
High-Performance Computing and OpenSolarisHigh-Performance Computing and OpenSolaris
High-Performance Computing and OpenSolaris
 
SVG como exemplo de XML
SVG como exemplo de XMLSVG como exemplo de XML
SVG como exemplo de XML
 
Questões de Certificação SCJP
Questões de Certificação SCJPQuestões de Certificação SCJP
Questões de Certificação SCJP
 
Microformatos em 10 minutos
Microformatos em 10 minutosMicroformatos em 10 minutos
Microformatos em 10 minutos
 
Participation Era, Sun and You
Participation Era, Sun and YouParticipation Era, Sun and You
Participation Era, Sun and You
 
Let's talk about certification: SCJA
Let's talk about certification: SCJALet's talk about certification: SCJA
Let's talk about certification: SCJA
 
Uma Olhada no Netbeans 6
Uma Olhada no Netbeans 6Uma Olhada no Netbeans 6
Uma Olhada no Netbeans 6
 
Novidades no Netbeans 6
Novidades no Netbeans 6Novidades no Netbeans 6
Novidades no Netbeans 6
 

Último

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Último (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Real World Technologies

  • 1. Real World Technologies: NetBeans GUI Builder, JRuby, JavaFX, and Java ME developers.sun.com/students/courses 1
  • 2. Topics • Introduction to “Real World Technologies: NetBeans GUI Builder, JRuby, JavaFX, and Java ME – Earn a Certificate” 5-hour online course • NetBeans GUI Builder • JRuby & JRuby on Rails • Java FX Programming • Java ME Programming 2
  • 3. Real World Technologies 5-hour Online Course • You can take it anytime – it is free! • http://developers.sun.com/students/courses • You get exposed to exciting and leading-edge real- life technologies • You do the hands-on lab and homework • If you submit all 4 homeworks, you will receive PDF version of certificate • You can participate in the course forum 3
  • 5. NetBeans GUI Builder (Matisse) • Issues with building GUI without Matisse > Complexity with Swing APIs > Resizing and Alignment are hard > Locale handling > Behave differently over different OS platforms • Matisse handles all these for you! > Guidelines provided at design time to help with placing and sizing controls > Adjustments made at runtime for user's look & feel and locale 5
  • 6. Free Design • You can build your forms by simply putting components where you want them as though you were using absolute positioning • The GUI Builder figures out which layout attributes are required and then generates the code for you automatically. > You need not concern yourself with insets, anchors, fills, and so forth. 6
  • 7. Automatic Component Positioning • As you add components to a form, the GUI Builder provides visual feedback that assists in positioning components based on your operating system's look and feel. • The GUI Builder provides helpful inline hints and other visual feedback regarding where components should be placed on your form, automatically snapping components into position along guidelines. 7
  • 8. Visual Feedback • The GUI Builder also provides visual feedback regarding component anchoring and chaining relationships. • These indicators enable you to quickly identify the various positioning relationships and component pinning behavior that affect the way your GUI will both appear and behave at runtime. > This speeds the GUI design process, enabling you to quickly create professional-looking visual interfaces that work. 8
  • 9. NetBeans GUI Builder Demo: These Are The Exercises You Will Do as Part of the Course
  • 10. Demo 1: Building a Contact Editor 10
  • 11. Demo 2: Adding Event Handlers 11
  • 12. JRuby & JRuby on Rails 12
  • 13. Topics • What is and Why JRuby? • What is “JRuby on Rails”? • “Ruby on Rails” Principles • Why “Ruby on Rails”? • Why “JRuby on Rails”? 13
  • 14. What is and Why JRuby?
  • 15. Open source Java implementation of the Ruby language 15
  • 16. What Is JRuby? • Started in 2002 • Java platform implementation of Ruby language • Open source, many active contributors • Aiming for compatibility with current Ruby version • Integrates with Java technology > Call to Ruby from Java technology via Java Specification Request (JSR) 223, BSF, Spring > Use Java class files from Ruby (e.g., Script Java) • Growing set of external projects based on JRuby > JRuby-extras (GoldSpike, ActiveRecord-JDBC,…) 16
  • 17. JRuby: Java Technology Integration • Script Java > Power of Java technology with the Syntax of Ruby require 'java' list = java.util.ArrayList.new list << 1 list << 3 list << 2 list.sort 17
  • 18. Why JRuby? • JRuby over Ruby > Strong likelihood we will be faster soon > Better scalability with native threading > Native unicode support > Compilation > Integration with Java libraries > Easier path to getting Ruby in the enterprise • JRuby over Java technology > Language features > Blocks, modules, metaprogramming, dynamic-typing > Ruby applications/libraries > Rails, Rspec, Rake, Raven, other R’s 18
  • 19. What is “JRuby on Rails”?
  • 20. What Is “Ruby on Rails”? • A full-stack MVC web development framework • Open source (MIT), many contributors • Written in Ruby • First released in 2004 by David Heinemeier Hansson • Gaining popularity > Ruby and Rails book sales are outselling Perl book sales 20
  • 22. “Ruby on Rails” Principles • Convention over configuration > Why punish the common cases? > Encourages standard practices > Everything simpler and smaller • Don’t Repeat Yourself (DRY) > Framework written around minimizing repetition > Repetitive code harmful to adaptability • Agile development environment > No recompile, deploy, restart cycles > Simple tools to generate code quickly > Testing built into the framework 22
  • 23. Why “Ruby on Rails”? • Greatly simplified web development > Instant applications: working code in minutes > “Less Rails code than Java application configuration” • Growing community of developers • Makes small apps trivial to create • Ruby is an excellent language 23
  • 24. Why “JRuby on Rails” over “Ruby on Rails”? • Deployment to Java application servers • Java technology production environments pervasive > Easier to switch framework vs. whole architecture > Lower barrier to entry • Broader, more scalable database support • Integration with Java technology libraries, legacy services • No need to leave Java technology servers, libraries, reliability 24
  • 25. “JRuby on Rails”: Java EE Platform • Pool database connections • Access any Java Naming and Directory Interface™ (J.N.D.I.) API resource • Access any Java EE platform TLA: > Java Persistence API (JPA) > Java Management Extensions (JMX™) > Enterprise JavaBeans™ (EJB™) > Java Message Service (JMS) API > SOAP/WSDL/SOA 25
  • 26. “JRuby on Rails”: Deployment Platforms • Mongrel > Built-in container • Warfile deployment to: > GlassFish™ V2 > GlassFish™ V3 > Servlet-based app server 26
  • 27. JRuby on Rails: Futures • Improve Java EE platform support for Rails > Rubify Java EE platform APIs > Create Rails plug-ins to make installable units • Use Java technology native equivalents > Unicode support > XML support • Port Ruby native libraries > RMagick 27
  • 28. JRuby on Rails Demo: These Are The Exercises You Will Do as Part of the Course
  • 29. Demo 1: Building WebLog Webapp 29
  • 30. Demo 2: Building Flickr Webapp 30
  • 32. Topics • What is and Why JavaFX? • JavaFX Product family and Architecture • JavaFX Script • JavaFX Script examples 32
  • 33. What is and Why JavaFX? 33
  • 34. Market Trends • Personal & mobile computing are blurring > Handsets becoming more advanced > Higher-speed IP Networks • Ecosystem shifting to “platforms” > Full application environment including middleware, user experience, etc. > Reduce development costs and improves device consistency • Software stacks largely proprietary > Industry looking for an Open alternative 34
  • 35. The GUI Quagmire • Java Swing and 2D APIs are very powerful and yet > Why does it take a long time to write GUI programs? > How can we avoid the “Ugly Java technology GUI” stereotype? > Why do Flash programs look different than Java programs? > Why does it seem easier to write web apps than Swing programs? > How can I avoid having an enormous mass of listener patterns? 35
  • 36. Why yet another scriting language for Java, JavaFX Script? • Language for Spicying up Java GUI Programing easier • Building and running of media/content- rich Java clients application much easier • More productive by making Swing and Java 2D™ API accessible to a much the script programmer • Simple Accessing of Java Objects • Serve as persistence format for a new class of tools targeted at non programmers like designers and end users 36
  • 37. Expanding the Community Professionals Programming (Java) skills Community size Java developers Script programmers Visual designers Hobbyist 37
  • 39. JavaFX Product Family • Announced at JavaONE 2007 • Leverages the Java platform's write-once-run- anywhere portability, application security model, ubiquitous distribution and enterprise connectivity • Initially comprised of: JavaFX Script > Highly productive scripting language for content developers to create rich media and interactive content JavaFX Mobile > Mobile software stack available via OEM license to carriers and handset manufacturers seeking a branded relationship with consumers 39
  • 40. JavaFX: An Architecture that Scales The Big Picture Home JavaFX Devices Desktop Content Authoring Tools Entertainment Mobile Interactive JavaFX Script Content JavaFX Framework 2D/3D AGUI PBP SVG/MSA CLDC CDC CDC SE 40
  • 41. JavaFX Workflow Visual Content developer Java FX Mobile Designer App Binary JavaFX Mobile g in ag ck Java FX TV JavaFX Script code Pa App Binary Visu ng ck agi JavaFX TV Pa al A sse n ts tio Pa la pi ck m ag Co Java FX Source ing Application Java FX Desktop App Binary JavaFX Tools JavaFX Desktop / Consumer JRE 41
  • 43. What is JavaFX Script? • Formerly known as F3 (Form Follows Function) of Chirstopher Oliver from Sun Microsystems > http://blogs.sun.com/chrisoliver/category/JavaFX • Java Scripting Language > Object-oriented > Static typing + type inference > Declarative Syntax > Automatic Data Binding > Mixed functional/procedural evaluation model 43
  • 44. What is JavaFX Script? • Extensive widget library encompassing Swing components and Java2D objects • Easily create and configure individual components • Work with all major IDEs • Statically typed - retains same code structuring, reuse, and encapsulation features of Java • Capable of supporting GUIs of any size or complexity • Makes it easier to use Swing • Rich Internet Applications (RIA) 44
  • 45. JavaFX Script – A Simple Comparison In JavaFX Script In Java Main guitar class  picks.opacity = [0, .01 .. 1 ] dur 1000 linear        guitarAnimationThread = new StringOpThread();        ......        ......        if (guitarAnimationThread != null) {           guitarAnimationThread.run();        } In Java        ......... (SwingLabs Timing StringOpThread class        ........... Framework)     public void run() { public void class Guitar {            opacityBegin = 0.01;        opacityEnd = 1.0;     private GuitarPick pick = ...;            opacityIncreStep = 0.02;     public Guitar() {            opacitySleep = 2;         pick.setOpacity(.5f);         for(currOpacity = opacityBegin;         Animator a =               currOpacity < opacityEnd;     PropertySetter.createAnimator(                 currOpacity+=opacityIncreStep) { 300, pick, quot;opacityquot;, .5f, 1.0f);           setPickOpacity();           repaint();         MouseTrigger.addTrigger(pick, a,           try { MouseTriggerEvent.ENTER, true);             thread.sleep(opacitySleep);     }           } catch (InterruptedException e) { } } 45
  • 47. Example : Hello world in Java FX import javafx.ui.*; Frame { title: quot;Hello World JavaFXquot; width: 200 height: 50 content: Label { text: quot;Hello Worldquot; } visible: true } 47
  • 48. Example : Hello world in Swing import javax.swing.*; public class HelloWorldSwing { public static void main(String[] args) { JFrame frame = new Jframe(quot;HelloWorld Swingquot;); final JLabel label = new JLabel(quot;Hello Worldquot;); frame.getContentPane().add(label); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); } 48
  • 50. Data Binding in JavaFX • Cause and Effect—Responding to change • The JavaFX bind operator—Allows dynamic content to be expressed declaratively • Dependency-based evaluation of any expression • Automated by the system—Rather than manually wired by the programmer • You just declare dependencies and the JavaFX runtime takes care of performing updates when things change • Eliminates listener patterns 50
  • 51. Example: Dynamic Behavior class HelloWorldModel { attribute saying: String; } var model = HelloWorldModel { saying: quot;Hello Worldquot; }; var win = Frame { title: bind quot;{model.saying} JavaFXquot; width: 200 content: TextField { value: bind model.saying } visible: true }; 51
  • 52. Java 2D 52
  • 53. Java 2D API • To match the designs of UI designers requires using Java 2D API • But Java 2D API doesn’t have compositional behavior > The barrier to entry for many Java code programmers is too high (i.e., other than Romain Guy) • In addition to Swing Components, JavaFX includes SVG- like interfaces to Java 2D API as first-class elements which can be composed together into higher-level components • JavaFX allows declarative expression of this composition 53
  • 55. Topics • What is and Why Java ME? • Java ME architecture • NetBeans Mobility Pack Features • Game development 55
  • 56. What is and Why Java ME? 56
  • 57. Why Develop Mobility Applications? • “Application at your fingertips” • Personal > One of 4 things you always carry with you (keys, wallet, watch, handphone) • Powerful, feature rich, programmable and royalty free > Games in particular • Anyone commuting will have 30mins to kill > Capture audience • It's not really that difficult 57
  • 58. The Java™ Platforms Java Technology Java Technology Workgroup High-End Enabled Devices Enabled Desktop Server Server 58
  • 59. Java on Mobile Devices Mobile Service Architecture (MSA) provides a complete platform for mobile application development 59
  • 60. Java ME Application Market $3B $3 Billion Java Mobile Game Market 60
  • 62. Java Platforms Optional Packages Java Platform, Optional Micro Edition (Java ME) Packages Optional Packages Personal Advanced Profile GUI Java (PP) (AGUI) Optional Packages Platform, Java PersonalBasis Profile (PBP) Enterprise Platform, JTWI/MSA Mobile Foundation Profile (FP) Edition Standard Information Device Profile (Java EE) Edition Connected (MIDP) Connected (Java SE) Device Limited Device Configuration Java Configuration (CDC) Card (CLDC) 62
  • 63. Java ME CLDC Stack • Connected Limited Device Configuration (CLDC) > For devices with limited memory and processing power > KVM (Kilo VM) Virtual Machine especially designed for devices with limited computing power and resources • Mobile Information Device Profile (MIDP) > Defines application model, OTA (over-the-air) installation, basic UI model and widgets, media capabilities, basic Game API, RMS (record management system), connectivity, security model 63
  • 64. Java ME CLDC Stack (2) • Multitude of optional JSRs: Media, Bluetooth, Messaging, Location, SIP, and many more • More JSRs are in the pipeline • “Umbrella” JSRs > Define a complete platform from existing JSRs • Example > JSR 185 (Java Technology for Wireless Industry/JTWI) > JSR 248 (Mobile Services Architecture/MSA) 64
  • 65. Java ME Evolution in Wireless MIDP → JTWI → MSA (Mobile Service Architecture) We are here MSA CDC (2007-08) Capability MSA Device CLDC JTWI (2006) CLDC MIDP (2003) CLDC (2001) 65
  • 66. Compelling Feature Phone Platform: MSA (JSR 248) Comms Graphics Security & Application Personal Commerce Connectivity Information JSR 82 JSR 226 Bluetooth 2D Scalable Vector Graphics JSR 180 JSR 184 SIP 3D Graphics JSR 205 JSR 234 JSR 229 JSR 211 JSR 179 MMS Mobile-media Content Payment Location Messaging Supplement Handler JSR 120 JSR 135 JSR 177 JSR 172 JSR 75 SMS Security & Mobile Media Web Services PIM & File Messaging Trust Services Application JSR 185 JSR 118 JSR 238 JTWI MIDP 2.0 I18N Environment Virtual JSR 139 Conditional APIs Machine CLDC 1.1 JTWI APIs 66
  • 68. Mobility Pack A full IDE built around Sun JavaTM Wireless Toolkit ● Open, ● Java ME integrated I D Platform development environment E emulation ● Build, test, SD ● Device deploy rich K agnostic applications ● Provides ● Accelerate additional application utilities for time-to- application market support ● Visual, drag- ● Over 2,000,000 combined n-drop downloads authoring ● Industry voted awards 68
  • 70. SVG • SVG = Scalable Vector Graphics • Automatically adjusts to screen size • Two roles > Graphical designers create images > Developers add business logic • Visual designer for SVG > SVG Menu, SVG Splash Screen, SVG Wait Screen, SVG Image, ... 70
  • 71. NetBeans 6.0 Mobility New Feature • New game builder > Easier to create mobile games with the Mobility Pack's visual editing support for the MIDP 2.0 Game API > API supports animated sprites and the ability to arrange tiled layers into scenes • New Integrated UI for CLDC/MIDP and CDC development • New Visual Mobile Designer • Design analysis • New components for Flow Control 71
  • 73. Development of Java Technology-Based Games • JSR 184 (3D Graphics) • 3D world creation and manipulation • JSR 135 (Mobile Media) • Sounds • JSR 82 (Bluetooth) • P2P gaming • JSR 180 (SIP) • P2P over the network • JSR 229 (Payment) • Payment of new levels 73
  • 74. Examples of 2D Games 74
  • 75. Core Game API Class Hierarchy 75
  • 76. Game Canvas • GameCanvas specifically for developing game display > Class extends GameCanvas to use it • Subclass of Canvas but provides the following improvements > Off-screen buffering > Keypad polling > Access to Graphics object > Do not need to override paint(Graphics) method • Behavior can be set to be backward compatible with Canvas 76
  • 77. GameCanvas Example – Main Game Loop 01 //main game loop 02 while (true) { 03 //Poll key press 04 int key = getK eyStates(); 05 if ((key & G ameC anvas.L EFT_PR ESSED) != 0) { 06 //update game objects 07 } 08 if ((key & G ameC anvas.UP_PR ESSED) != 0) { 09 //update game objects 10 } 11 //Get off-screen graphics object 12 G raphics g = getG raphics(); 13 //update game screen 14 ... 15 //update the 'dirty' portion to the screen 16 flushG raphics(x, y, dirtyW idth, dirtyHeight); 17 } 77
  • 78. Elements in a Game Background Sprite • Background > Composable from basic elements > Static and animated objects • Background layers > Different layers > Layer management • Sprites > Transformation > Collision detection Viewport 78
  • 79. Creating a TiledLayer tileHeight TiledLayer background = new TiledLayer( 50, 50, image, tileWidth, tileHeight) tileWidth 79
  • 80. Creating the Background 5 5 5 5 5 5 5 5 5 5 5 5 // Draw the water for (int x = 0; x < 12; x++) background.setCell(x, y, 5); Tile index 80
  • 81. Creating Animated Tile //Indicate the tile to be animated int animatedTile = backgroud.createAnimatedTile(5); //Switch the animated tile backgroud.setAnimateTile(animatedTile, 6); 81
  • 82. Creating Sprites Loading is similar to TiledLayer Calling nextFrame() will display the next frame 82
  • 83. Changing the Frame Sequence sprite.setFrameSequence (new int[] {0, 1, 2, ... 1, 1}); sprite.nextFrame(); 83
  • 84. Reference Pixel on Sprites Default reference pixel at (0, 0) 84
  • 85. Real World Technologies: NetBeans GUI Builder, JRuby, JavaFX, and Java ME 85