FX Experience Has Gone Read-Only

I've been maintaining FX Experience for a really long time now, and I love hearing from people who enjoy my weekly links roundup. One thing I've noticed recently is that maintaining two sites (FX Experience and JonathanGiles.net) takes more time than ideal, and splits the audience up. Therefore, FX Experience will become read-only for new blog posts, but weekly posts will continue to be published on JonathanGiles.net. If you follow @FXExperience on Twitter, I suggest you also follow @JonathanGiles. This is not the end - just a consolidation of my online presence to make my life a little easier!

tl;dr: Follow me on Twitter and check for the latest news on JonathanGiles.net.

Top 10 Changes in JavaFX 1.3

A few weeks ago we started assembling our own Top 10 change list for JavaFX 1.3. Stephen posted an excellent list of his own. Here’s our take! Over the next several weeks we will be writing about each of these topics in greater detail and link them back to this page. So without futher ado…

10. Amble Font
We’ve added some standard fonts to JavaFX which are available to all devices: desktop, mobile and tv. What this means to you is a single consistent set of fonts which look consistent on all platforms. Happiness all around!

09. Multiline Text Input
Finally(!!), JavaFX 1.3 brings support for multiline text input to the venerable TextBox. TextBox already worked for single-line single-style text input, and in 1.3 we added the ability for the TextBox to also support multiple lines of text!

08. ChoiceBox
One of the most hotly asked for new Controls was a ComboBox. ChoiceBox is a close cousin (and in our experience is used more frequently). The ChoiceBox is essentially a non-editable ComboBox. You can put any kind of data item in the ChoiceBox and let the user choose an item.

07. Layout Enhancements
A lot of work went into enhancing and simplifying the layout system in JavaFX 1.3. The majority of porting issues you will face going from 1.2 to 1.3 will be in the area of layout. It is faster, simpler, and ready for business.

06. Preview Controls
In 1.3 we have added a number of preview controls. Please try them out! They absolutely will change when they become final controls (including moving from the com.javafx.preview package in which they live), but we wanted to get them out as soon as possible so you can have a play and provide input into their continued development. In 1.3 the main preview controls are Menus (MenuItem, PopupMenu, MenuBar, etc) and TreeView. Try them out!

05. Custom List Cells
In JavaFX 1.2 we released a very lightweight ListView Control. It barely made the 1.2 release at all. In 1.3 we’ve extended it to support completely customizable cells. One of my major regrets was that ListView is still single selection in 1.3 (bummer). That being said, the ListView’s cell virtualization absolutely rocks.

04. Lazy Scenegraph
We’ve made the scenegraph lazier! What this means for you is much better performance. “Bind storms” have been eliminated from all bounds related aspects of the scenegraph, so now we don’t compute bounds unless you ask for them. We’ve seen major improvements in applications which once were limited by such bind storms.

03. JavaFX Compiler Rewrite
The JavaFX Compiler team has done it again! The JavaFX Compiler has seen some major improvements in this release, both in the type of code being generated and how those changes effect applications. The semantics of “bind” have been better defined, and all binding is now “lazy” to help quell bind storms (lazy binding means that a value is not recomputed when its inputs have changed, only when it is asked for a new value). We sometimes refer to this as “compiled bind” because in previous releases bindings were essentially interpreted whereas in 1.3 the compiler generates more bytecode for each binding which gives hotspot more to work with and, critically, reduces the dynamic footprint of a Node by 6-10x!

02. CSS
The biggest feature for the JavaFX UI Controls team in the 1.3 release is without a doubt the CSS support that was reengineered from the ground up, extended, and improved. It is also now available on all three platforms — desktop, mobile, and tv. We’re really excited about this support as it gives developers and designers much more freedom in how to style controls and really makes some very common use cases much, much simpler.

01. TV
Finally, in JavaFX 1.3 we have added an emulator for TV which allows you to develop JavaFX applications for the TV or TV set top boxes. This is the FX Experience #1 top change for JavaFX 1.3 as it completes the promise of having a platform targeting all three screens (desktop, mobile, tv). The TV implementation is based on the new prism 3D accelerated pipeline. We’re very excited to see where this leads and to put more heat into this and our other platforms in future releases.

If you haven’t yet, download JavaFX 1.3!

Welcome JavaFX 1.3

JavaFX 1.3 is here!

With the pushing of the bits yesterday, those of us on the JavaFX team are finally able to talk about the work we’ve been doing for nearly the past year (has it been so long?!). A tremendous amount of work from many skilled engineers has gone into making this release the fastest, richest, and most productive release of JavaFX to date. Ok, so we’re somewhat biased :-).

One of the things that has been gratifying about working on this project is that each release of JavaFX gets an order of magnitude better than the last. The compiler team has done amazing work in this release related to both raw performance and also dynamic footprint (the amount of memory used by each JavaFX object). Both the 1.2 release and the 1.3 release bring us a lot closer to the type of performance we know the Java platform is capable of.

Stephen Chin posted a great top ten list yesterday about features that have gone into 1.3. We’ll be posting our own list shortly, which ranks things a little differently but is essentially a lot of the same stuff :-). We’re also going to be posting a lot more detail about these features in the coming weeks.

In addition to all of these new features, we spent a significant chunk of time early on in this release working on “technical debt” we’d acquired prior to and including the 1.2 release. We had been on such a pace that various bits of underlying infrastructure and architecture needed some real TLC. In 1.3 we paid down that debt and are really well placed for future improvements.

A lot has been said in the past about “bindstorms” — a term coined to refer to situations where simple applications with liberal usages of bind would come to a screeching halt. Immediately after 1.2 was released we set to work planning for and making the changes necessary to quell these storms. In a future post we’ll go into detail about how this was done, and what this means to you as a programmer (summary: you pretty much get it for free).

Another area where we paid down technical debt was in the underpinnings of the scenegraph and how it was ported onto different platforms. The TV and desktop implementations of JavaFX share a tremendous amount of code which as an engineer is really great to see. For the most part, the TV team has been able to focus on the deep integration with the system and hasn’t had to worry about the scenegraph implementation at all.

The big compiler rewrite was a huge deal in this release. You can now create thousands and thousands of Nodes in your scenegraphs now without running out of heap or overly stressing the system. The new compiler implementation really puts us in a great spot going forward. There might be a few hiccups with tooling for a couple months but we’re ironing all those bits out as fast as we can.

The other major improvement in this release that really cannot be overstressed is the work that was done with CSS and being able to style all of the controls from CSS. We’ve taken standard CSS and added a couple powerful concepts (which I would love to see HTML CSS adobt back) which really make styling of controls very elegant.

The layout system was another area that got a lot of attention in this release that we are really pleased with. In previous releases there was a tension between container-based layouts and bind-based layouts. In this release, we’ve adjusted a few of the semantics such that the two different layout methodologies share the same basic semantics and behaviors. We’ll definitely be posting more about this as time goes on (I’m sure Amy has something in the works already).

Existing controls such as ListView and TextBox got significant new features. The ListView now has support for custom cells, which are capable of doing just about anything. And its fast. We actually improved the performance of this control by 50% while adding tons of new richness and functionality.

The TextBox can now be configured for either single-line or multi-line text input. It still isn’t rich text (bummer), but for basic text input this Control is now ready for business.

Lots of work went into preview controls (of these the TreeView is one of my favorites), new controls (PasswordBox, ToolTip, ScrollView, Separator, more), and improving existing controls (Slider, ProgressIndicator, more). The Skin implementations for all of the controls were completely rewritten. They are now about 20% of the size of the old skins and all the visuals are now defined in CSS — which means that you the developer or designer have tremendous leverage in giving the controls all new styles.

After all is said and done, the best thing about JavaFX is the programming experience. From the language to the APIs, things fit together well and are a joy to use. We work on this project because we love to build great technology and are committed to making each release better than the last. If you have bugs, feature requests, or optimizations please file issues in our issue tracker.

So what are you waiting for? Download JavaFX today!

JavaFX links of the week, April 19

It’s time for another weeks worth of links from the JavaFX world. This week we have a range of different articles, so hopefully there is something for everyone. Enjoy.

Just a FYI: for the next two weeks I’m in Silicon Valley so whilst I’ll try to post new links I can’t guarantee anything. Be prepared for some silence, and perhaps follow me on twitter – perhaps I’ll post interesting links straight to there for a few weeks as well.

That’s all folks. Catch you in a weeks time…..hopefully.

JavaFX links of the week, April 11

Wow – this weeks post has a number of really good links for people who are interested in JavaFX. Let’s get right into them!

  • Just a reminder: Stuart Marks is presenting at the Silicon Valley JavaFX Users Group on April 14 at the Oracle headquarters in Redwood Shores. Remember, you can also watch the presentation live online, time zones permitting 🙂 For those that don’t know Stuart, he is a member of the JavaFX Controls team, and he’s been at Sun nearly as long as I (Jonathan) have been alive (give or take one year) 🙂
  • Rakesh Menon has created a modal dialog in JavaFX, and it actually works very nicely (with the constraints present in JavaFX 1.2). Check it out if you need a modal dialog for your application.
  • Stephen Chin has announced the release of JFXtras 0.6, which is a long time in the making and as such has a heap of new stuff. Check out Stephen’s post to find out more details. Somewhat embarrassingly my menu control turns up in there. Apologies in advance to anyone using that set of controls 🙂 As noted elsewhere, improved menu controls turn up as previews in JavaFX 1.3.
  • Speaking of new JavaFX controls, I stumbled upon the MindFusion UI Pack for JavaFX this week which is a commercial controls pack for JavaFX. My only comment: be weary as to whether this’ll work in JavaFX 1.3 before splashing out some cold hard cash for it.
  • Eric J Bruno has published an article on Dr Dobbs titled ‘JavaFX Database Programming with Java DB‘.
  • A new release of the JavaFX Plugin for Eclipse has been released, taking it up to version 1.2.4.

That’s things for another week – I hope you enjoyed these links. As always, keep up the hard work folks and I’ll catch you all in a weeks time.

JavaFX links of the week, April 5

Another week, another bunch of interesting links. This weeks standout links are probably the blog post by Stuart Marks, and Simon Morris‘ new XML library for JavaFX. What do you think – was there better or bigger JavaFX news in the last week? If so, leave a comment and let us know!

Keep up the good work folks – we enjoy reading what you’re all up to, and it’s our pleasure to help present your hard work to the public. As always, feel free to contact me if you feel like you want something covered in next weeks post.

JavaFX links of the week, March 29

Wow, a heap of links this week for JavaFX. Also, if you’re remotely interested in JavaOne, it’s important to note that registration is now open for JavaOne 2010. From looking at the session proposals for the JavaFX track, it’s going to be a really good year! Righty, on with the links.

  • A lot has been said this week about whether or not JavaFX is ready for the prime time. Coming out to give his perspective on the issue is Adam Bien, who lists 11 reasons why he thinks JavaFX is on the right path.
  • Tor Norbye has blogged about transparent windows in Linux, based on his experience in building the upcoming Authoring Tool and testing it across platforms.
  • Johan Vos has blogged about map rendering in JavaFX using data from OpenStreetMap. He provides both a runnable demo, and also the code. What’s most fascinating is how little code was actually written to support this – it really is a tiny amount.
  • Rakesh Menon created a Wizard UI in JavaFX which is actually quite nice, and certainly usable for people wanting to show wizards in JavaFX.
  • Exadel have released version 1.2.3 of the JavaFX Plugin for Eclipse. They have also announced that they plan to release more regular, and smaller, updates for the plugin (once every two weeks or so).
  • Nathan Erwin emailed me about a Maven Javafxdoc plugin that he has been working on. This allows for you to easily generate JavaFX API documentation as part of the Maven build process.
  • Peter Pilgrim has posted a new demo of his Moonlander game, which along with providing a new stage also fixes a few bugs.
  • Joshua Smith has blogged about static fields and functions in JavaFX. This is one of those areas that differs from how it is done in Java, but it’s certainly still possible in JavaFX to have static fields and functions.
  • If you’re wanting to learn more about JavaFX then Sang Shin has a slide deck titled “JavaFX: Building RIA Application” you should check out. Unfortunately, the ‘Application’ part of the title is a little redundant given the RIA acronym preceding it, but it’s a very easy trap to fall in to.

Hope there was something useful in these links for everyone. As always, feel free to get in touch with us if you have any links or comments you want to share. Catch you all again in a weeks time!

JavaFX links of the week, March 22

Only a few interesting links this week, all included below. Perhaps most interesting is the NetBeans team work on integrating JavaFX code within a NetBeans RCP application.

Hope you learnt something new this week 🙂 As always, email me any links you may have, and I’ll be back again next week.

JavaFX links of the week, March 15

Not a huge number of links this week in the JavaFX camp, but what we do have below are some very interesting articles in a number of diverse areas. I hope you find them interesting, and as always, please email me any links you would like to have included.

That’s us for another week. Keep up the great work everyone, and we’ll do our best to keep linking to it.

JavaFX links of the week, March 8

Who would have thought it – I just uncovered another bunch of JavaFX links! Of particular interest to many might be the interview that Oracle did with Nandini Ramani, where she outlines the plans for JavaFX in more detail. Of course, that’s not all the community has in store for you this week – so let’s get right into the news (so I don’t have to keep thinking of something to say 🙂 ).

As always, thanks to the people sending in links, it’s always fascinating to see what the community is doing. Keep up the hard work and I’ll see you again in a weeks time.

Creating a partially rounded rectangle

After seeing a twitter message today asking whether it was possible to create a rectangle in JavaFX which was a mixed rounded and normal rectangle, I thought I’d post how I did this a few months back.

The code below will draw a rounded rectangle in the top-right, bottom-right, and bottom-left corners. The top-left corner is a square point. You can change this by editing the four parameters, and of course trivially modify this code to be a function taking four arguments.

The reason why I have the test for if (topRightCurve > 0) is because when I was writing this code there was a known issue with drawing arcs with a zero radius. I know this has been fixed, but I’m not sure when it was fixed (it may be in 1.2, but most certainly it’s fixed in 1.3).

[jfx]
public var topLeftCurve:Number = 0;
public var topRightCurve:Number = 0;
public var bottomLeftCurve:Number = 0;
public var bottomRightCurve:Number = 0;

Path {
fill: color
stroke: stroke
strokeWidth: 1
elements: bind [
// starting just past the top-left curve
MoveTo { x:topLeftCurve, y:0 },

// draw line to where top-right curve should start
HLineTo { x:menuWidth – topRightCurve },

// arc around to just below the top-right curve
if (topRightCurve > 0) {
ArcTo {
x:menuWidth, y:topRightCurve,
radiusX:topRightCurve, radiusY:topRightCurve,
sweepFlag:true
}
} else null,

// go to just above the bottom-right curve
VLineTo { y: menuHeight – bottomRightCurve }

// arc around to just to the left of the bottom-right curve
if (bottomRightCurve > 0) {
ArcTo {
x:menuWidth-bottomRightCurve, y:menuHeight,
radiusX:bottomRightCurve, radiusY:bottomRightCurve,
sweepFlag:true
}
} else null,

// draw line to where bottom-left curve should start
HLineTo { x:bottomLeftCurve },

// arc around to just above the bottom-left curve
if (bottomLeftCurve > 0) {
ArcTo {
x:0, y:menuHeight-bottomLeftCurve,
radiusX:bottomLeftCurve, radiusY:bottomLeftCurve,
sweepFlag:true
}
} else null,

// go to just below the top-left curve
VLineTo { y: topLeftCurve }

// arc around to just above the bottom-left curve
if (topLeftCurve > 0) {
ArcTo {
x:topLeftCurve, y:0,
radiusX:topLeftCurve, radiusY:topLeftCurve,
sweepFlag:true
}
} else null
]
}
[/jfx]

Also, if you’re using the JFXtras project, there is a shape in there, called the MultiRoundRectangle that does precisely this as well.