JavaFX Script

January 02, 2008

The Future of JavaFX Script Animation: Key-Frame Animation

The current form of animation in JavaFX Script (i.e. using the dur operator) has been a temporary measure until something more elegant, usable, and powerful was created.  Chris Oliver has unveiled his vision for the future of JavaFX Script animation, which employs the key-frame animation model used in traditional animation and visual design tools.

Please take a look at Chris's explanation, and demos, of key-frame animation implemented in JavaFX Script.  One of the examples is a video poker game (see screenshot below), in which you can try your skill/luck at five card draw. 

Videopoker

Be sure to try out the other four demos, and then experiment with the special version of JavaFXPad that lets you play around with the planned features of the key-frame animation model.

Regards,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
Immediate eBook (PDF) download available at the book's Apress site

December 25, 2007

Spotting JavaFX Apps in the Wild - Santa's Super Status System

There's been a Santa sighting!  Check out this JavaFX Script application over at Joshua Marinacci's blog.

Santassuperstatussystem

By the way, I received a nice Christmas present yesterday.  My JavaFX Script book has been available as an eBook download since early October, but the printed book had been delayed.  When I got home last night on Christmas Eve, I almost tripped over the box on the porch that contained the printed book.  I went online and found that Amazon.com and Apress has them in stock and is currently shipping them (finally!)

Merry Christmas,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
Immediate eBook (PDF) download available at the book's Apress site

December 12, 2007

JavaFX Related Happenings at JavaPolis 2007 Days 2 and 3

Greetings again from JavaPolis 2007 (AKA Europe's JavaOne).  Days 2 and 3 of the conference (Tuesday, December 11 and Wednesday, December 12) have had lots of activity and a couple of announcements surrounding JavaFX:

  • On Tuesday, I presented a three hour "university" session entitled JavaFX in Action.  To deliver the presentation, instead of creating presentation slides, I created a presentation engine in JavaFX Script that looks just like the slide templates required for the conference.  This allowed me to showcase some of the JavaFX graphics and animation capabilities, and to do most of the demonstrations within the context of the slides themselves.  For fun, and audience involvement, I gave away some JavaFX Script eBook downloads to audience members that asked good questions.  I made paper airplanes out of the download authorization codes so that I could throw them to audience members.  When this session is posted online on the JavaPolis site, I'll give you a heads-up in case you want to see it. 
  • Speaking of animation and graphics, Sun announced Project Scene Graph, which is an API library that provides an abstraction for some very impressive graphics capability.  This is the graphics library that JavaFX Script uses behind its declarative graphics code, e.g. Rect {...}, but Java programs can use it as well.  It is open source now, under the GPL license.  Joshua Marinacci has a great article in his weblog about Scene Graph.
  • Another JavaFX related announcement is the NetBeans 6.0 final release.  Its JavaFX plug-in has some very nice features, and James Gosling mentioned in the keynote session on Wednesday that NetBeans has many improvements such as context-aware code completion and UI/editor enhancements.
  • Also at the Wednesday keynote, James Gosling emphasized that Sun is prototyping JavaFX UI designer tools targeted at graphics designers as well as application developers.  One possible platform for this tool is NetBeans, but this hasn't been decided.
  • Angela Caicedo (a Sun Java "Evangelist" and JavaFX Script fanatic like myself) presented a couple of JavaFX Script applications that she'd developed.  One of them was a very nice looking and usable Twitter front end, and the other was a touchscreen based picture organizer and viewer.
  • James Gosling also discussed JavaFX Mobile a bit, mentioning that it will be a "complete mobile phone stack" that will make use of JavaFX Script (presumably the compiled version) to provide application UIs.
  • James also discussed Java SE 6 Update N, and some of its current and planned features, including a new deployment toolkit, a new installer with a Java Kernel, and a new browser plug-in that will support JavaFX Script running in a browser.  He mentioned that a JavaFX program, as well as an applet, will have the ability to be dragged out of the browser an into its own window.
  • I gave an abbreviated (one hour) presentation on Wednesday entitled JavaFX Script, drawing from some of Tuesday's longer presentation and adding some material that I've put in this LearnJavaFX weblog.  I had received feedback during the Tuesday presentation that the audience wanted to see more code and briefer demos, so I took that advice for this presentation.
  • While I was watching the last session of the day, I sat next to a couple of nice people that asked me if I had any more airplanes (with JavaFX Script eBook download codes).  I gave each of them one, and noticed later that evening that one of them (Elise Huard) had written a nice blog post about it, which I appreciated.

I also appreciated the very nice JavaFX Script book review that Robert Eckstein of Sun wrote and then linked from the java.sun.com home page.  Robert also has a nice video blog on JavaFX Script that you'll want to check out!

Regards,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
eBook (PDF) download immediately available at the book's Apress site

December 03, 2007

The OpenJFX Community Site Gets a Makeover

I am very happy to see that the OpenJFX Community (AKA Project OpenJFX) site has received a makeover, making it a more inviting and navigable resource.  Kudos to Eric Renaud, Cindy Castillo, and other members of the OpenJFX team for their web-mastery, and to the OpenJFX community for the resources available from this site. 

The tag line for the site is now "A Community Call to Action", which denotes that it's up to all of us to contribute to the progress of OpenJFX.  Check out the site and get more involved!

Projectjfx_site

Enjoy,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
eBook (PDF) download available at the book's Apress site

November 22, 2007

Availability of JavaFX Script Book - PDF Download vs. Paperback

December 24, 2007 update to this post: The paperbacks of the JavaFX Script book are now shipping.

I have been asked about the availability of JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications.  The book is available as an immediate PDF download at http://www.apress.com/book/view/1590599454, and paperbacks should be shipping soon.  The book is based upon the interpreted (current) version of JavaFX.  The compiled version of JavaFX Script is still in flux, and when the first milestone release is available, I will quickly update the book.  The Apress "firstPress" brand is geared toward this purpose, in that the eBook can be made available quickly, and the paperback is typically "print on demand".  I have been involved in providing input to the JavaFX compiler development team, and am currently assisting in the testing efforts, so the process of updating the book for the compiled version should go very quickly.

By the way, the UI libraries won't change much in the first release of the compiled version -- only some of the syntax of the language.  Please see the Putting My CTO Hat On post for my company's plans for use of the current (interpreted) version, and the compiled version, of JavaFX Script.

Regards,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
Immediate eBook (PDF) download available at the book's Apress site

November 19, 2007

The JavaFX Script Plugin for NetBeans 6 is Now Open Source

In an earlier post, I pointed you to JavaFX plug-ins that you can use with the NetBeans and Eclipse IDEs (integrated development environments).  The NetBeans plug-in is now open source, as announced in the OpenJFX Announcements forum in this post, shown here for your convenience:

JavaFX(TM) Script Plugin for NetBeans(TM) IDE  6.0 is now
open source! The source code is subject to the terms of  the
GNU General Public License Version 2  ("GPL") and the Common
Development and Distribution License("CDDL") terms.  Request
your module role now via http://javafx.netbeans.org.
Download! Get involved! Contribute! Enjoy!

To get the plug-in (and NetBeans while you're at it), and to get involved in this open source initiative, visit  the JavaFX Script Language Support for the Netbeans IDE site at http://javafx.netbeans.org

Regards,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
eBook (PDF) download available at the book's Apress site

November 16, 2007

Spotting JavaFX Apps in the Wild - WeatherFX - Hurry up JavaFX Mobile!

Here's a JavaFX Script demo application from the Project OpenJFX site that would be great for a mobile phone (when JavaFX Mobile is ready for prime-time).  It gets live weather information for three cities around the world and displays it in a graphically pleasing and functional way using vector graphics and images.  For each city you can choose between today's weather and tomorrow's forecast.  As I've mentioned before, I'm graphically challenged, but I can spot a cool looking app when I see it.  Check it out via this Java Web Start link.  For more information on this application, see the this page on the Project OpenJFX site.

Weatherfx

Regards,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
eBook (PDF) download available at the book's Apress site   

November 14, 2007

BindListBoxToSequence (JavaFX Puzzler 3) Results and Sample Solution

Congratulations to Lucas Benedicic for submitting the first solution to the BindListBoxToSequence Puzzler, and the fact that it met the requirements of the problem!

For reference, here is my sample solution, followed by the screenshot:

/*
* BindListBoxToSequence.fx
*/

import javafx.ui.*;

class ListBoxModel {
  attribute entries:String*;
}
attribute ListBoxModel.entries = [];

Frame {
  var model =
    ListBoxModel {
    }
  var elementTextField =
    TextField {
      columns: 12
    }
  title: "Bind ListBox to Sequence Puzzler"
  content:
    BorderPanel {
      top:
        FlowPanel {
          content: [
            elementTextField,
            Button {
              text: "Add Element"
              defaultButton: true
              action:
                operation() {
                  insert elementTextField.value into model.entries;
                  elementTextField.value = "";
                }
            }
          ]
        }
      center:
        FlowPanel {
          content:
            ListBox {
              fixedCellWidth: 200
              cells: bind foreach (entry in model.entries)
                ListCell {
                  text: entry
                }
            }
        }
    }
  width: 400
  height: 250
  visible: true
}

Bindlistboxtosequence

Congratulations again, Lucas!  I'll contact you right away with instructions on downloading the JavaFX Script eBook.

Regards,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
eBook (PDF) download available at the book's Apress site

JavaFX Puzzler 3 - First Correct Solution Gets Free JavaFX Script eBook

This post contains JavaFX Puzzler 3, which will make use of some of the JavaFX concepts that you've learned from this blog, including ones that you've explored in the resources to which I've been pointing you (hint: especially the Learning JavaFX Script, Part 1 tutorial, and the ListBox section of the Learning More About the JavaFX Script Language Tutorial).  The first person to post a comment with a correct solution will be given a free JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications eBook (PDF download).  When submitting your answer, be sure to put your correct email address in the  "Email Address: (Not displayed with comment.)" text field on the comment form so that I can contact you with the information to obtain your free eBook.

Requirements for Puzzler 3: The BindListBoxToSequence Program

Here is a screenshot of the sample solution:

Bindlistboxtosequence

The requirements for this program are as follows:

  1. The UI must have a similar, but not necessarily identical, appearance as the screenshot shown above.
  2. The program must contain a class named ListBoxModel that contains an attribute named entries.  The entries attribute contains a sequence (array) of type String.  Note: ListBoxModel and entries are arbitrary names, not required by JavaFX Script.
  3. When the user types a word into the text field and clicks the Add Element button, the word is added to the entries sequence.  The Add Element button must be the default button, so when the user types into the text field and presses the Enter key, the same result occurs.
  4. The cells attribute of the ListBox must be bound to the entries attribute of the ListBoxModel, so as elements are added to the sequence, they appear in the ListBox.

By the way, if you're looking for some starter code like I supplied in the last Puzzler, you won't find any. :-D

Enjoy!
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
eBook (PDF) download available at the book's Apress site

November 13, 2007

I Hear Voices - RIAs are the Future (Remix)

I remember how excited I was in 1995 when stumbling upon an alpha release of Java.  I was a Systems Architect for a large technology firm at the time, and had recently finished an evaluation of several cross-platform (Windows, Motif, Mac) application development tools.  The result of the evaluation was disappointing in that there seemed to be no good choice.  Then came Java... 

Applets, for me, represented a way that our company could deliver applications that were as rich in UI features as the C++/GUI toolkit applications that we had been developing for each of these platforms individually.  I began creating proof of concept applets on the Netscape Navigator browser, and looked forward to a happy future where Java applets would run on all browsers.  After all, it made sense (to me anyway) that the Java Runtime Environment should be included on all browsers.  Then came the browser wars...

To say that I (and much of the development community) was disappointed with results of the browser wars would be an understatement:

  • Java applets, even with the Java Plug-in, never became a serious option for rich, cross-platform, internet applications.
  • Technologies (e.g. HTTP and HTML) that were originally meant to share information, were suddenly being employed to support N-tier applications.  The fact that there are different flavors of HTML didn't help accomplish this feat.
  • JavaScript, with its different flavors, became an enabler (in the co-dependent sense perhaps) of this trend.
  • Many web-based applications today consist of various technologies, that when combined, are very difficult to maintain (again, an understatement).

I remember how excited I was in 2007 when stumbling upon an alpha release of JavaFX Script...

Can We Get this RIA Thing Right This Time?

I personally am not hung up on the Flex vs. JavaFX vs. whatever debate.  They all have their strengths, and there is room for more than one RIA technology.  I've been a Java developer and author since 1995, so I have a preference for being able to leverage the power of the Java and Java Swing libraries from the simple declarative scripting of JavaFX Script.  In fact, as you may have read between the lines of my book and blog, I'm quite enamored with JavaFX Script for developing rich internet applications, not to mention how cool it will be on mobile devices.

As I said in the Putting My CTO Hat On post, "What I'm really hoping for in the 2008-early 2009 timeframe is that the deployment for JavaFX applications (including the JRE) will be so fast and easy that we'll be writing rich-client JavaFX applications in most cases (rather than defaulting to browser-based applications)."  I'm betting that Compiled JavaFX Script and the technology formerly known as Consumer JRE will help get us there.

Some of the Voices I've Been Hearing

"Basically, I want what Java Applets promised 10 years ago, but in a form that actually works.  How does JavaFX and Java Web Start fit in with this?" -Paul Browne.  Visit Paul's blog.

"Java applets, or something like it, is having a comeback. And this time, it just might work. I'm not predicting that Sun will win. As a matter of fact, I wish every product in this space wins. However, what I can predict is that classical web app development will fade away as a viable IT option within 3 years. Surely Google and Yahoo and Amazon.com will still be putting out web apps, but for the most part, ordinary people won't be writing HTML or even thinking HTML anymore. -Weiqi Gao.  See "Java's Game Changing Move: The First Step" in Weiqi's blog.

"There's so much more that can be done, and I think this represents a potential flowering of the capabilities of the Internet. Notice I didn't say "the capabilities of the Web" but of the Internet, because it seems to me that the Internet has been held back by the web browser." -David Herring.  See "Freeing the Internet from the Web jail" in David's blog.

"Folks, the browser platform is passé. The race for the next round of cross-platform (note: not cross-browser) internet applications (note: not web applications) has already started. And my prediction is that JavaFX Script will win." -Weiqi Gao.  See "JavaScript To Fragment, The End Of The Reign Of The Browsers" in Weiqi's blog.

In the interest of full disclosure, Weiqi Gao is the technical reviewer of my JavaFX Script book (and he did an awesome job in reviewing it and providing technical input by the way).

Fair Warning on the Next JavaFX Puzzler

The next JavaFX Script Puzzler is planned to be posted at 18:00 GMT (1:00 pm EST) on Wednesday, November 14.  Study up! :-D

Regards,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
eBook (PDF) download available at the book's Apress site