JFXtras 0.6 Final Released
steveonjava | April 5, 2010
I am pleased to announce the 0.6 release of the open-source JFXtras project, the largest 3rd party library of JavaFX add-ons. This release is a very large undertaking that represents the work of several dozen contributors over the past 6 months.
JFXtras 0.6 will work with any JavaFX release in the 1.2 family. We recommend using the very latest release (currently JavaFX 1.2.3), which can be downloaded from JavaFX.com.
Starting immediately, we will be focusing on developing a JavaFX 1.3 compatible JFXtras release. Our plan is to release a 1.3 compatible version of JFXtras within 1 week of the official release announcement from Oracle. To hear about future JFXtras release announcements, make sure to follow my blog.
JFXtras Functionality
To make it easier to see some of the JFXtras capabilities in action, I have included Web Start demos from our component test library. It may take a minute or two to load the first demo, but after that the rest should launch instantaneously.
Data-Driven Controls
The JFXtras controls include a Table, Tree, Shelf, Calendar, PasswordBox, Picker, Spinner, MultiLineTextBox, ScoreBoard, and Menu. Many of these controls can be driven off a dynamic data provider that gives back incremental results from an asynchronous operation, such as a Web Service call.
XTableView (browse demo source)
XShelfView (browse demo source)
XPicker (browse demo source)
Advanced Layouts
The JFXtras layouts include the XGrid, XMigLayout, and Resizable versions of Stack, HBox, and VBox. All of these layouts support dynamic animation and a powerful defaults system. The JFXtras XGrid has been contributed back to Oracle and will be included in the JavaFX 1.3 release.
XGrid (browse demo source)
Wipe Library
Wipe transitions including: blind, fade-out, fade-reveal, fade, fade-zoom, flip-180, reveal, shape, slide-over, slide, and swing-in as featured in Simon Morris’ JavaFX in Action book.
Wide Demo (browse demo source)
Shapes
JFXtras includes a wide selection of skinnable shapes including: Almond, Arrow, Asterisk, Astroid, Balloon, Cross, Donut, ETriangle, Gear, ITriangle, Lauburu, RTriangle, Rays, RegularPolygon, ResizableEllipse, ResizableRectangle, ReuleauxTriangle, RoundPin, Sphere, and Star.
Shapes Demo (browse demo source)
Borders
We also have a large set of skinnable borders including: bevel, ellipse, empty, etched, frame, image, line, metallic, pipe, raised, rounded, shape, soft, and titled.
Borders Demo (browse demo source)
And a Whole Lot More
Here are some of the other features JFXtras has to offer:
- XStore Data Storage – Simple persistence of JavaFX primitives and sequences with defaults, auto-save, and save-on-exit.
- Asynchronous JavaFX Support (for experts only) – Allows invocation of JavaFX code off the EDT either via a SwingWorker-style callback or a set of closure-driven primitives.
- Swing Integration – Via the original SceneToJComponent wrapper or the new, easier to use, JXScene class.
- Custom Cursors and Paints – Allows you to use custom cursors and custom paints within your JavaFX application via a special Toolkit as featured in Jeff Friesen’s articles.
- Interpolatable and HSB Gradients – Ever wanted to animate a color? This is the perfect solution, complete with support for an HSB color palette.
- Bindable XMap – A simplified map syntax for use with JavaFX that includes bind support on gets.
- Image Caching – An image caching library that supports high performance, asynchronous loading and sizing of images from URLs.
Documentation
The full API is documented online here:
http://jfxtras.googlecode.com/svn/site/javadoc/release-0.6/index.html
We also have a new documentation wiki on the JFXtras website. Please browse it for ideas on how to use the JFXtras components and feel free to comment or contribute back to the docs to make them better:
http://jfxtras.org/portal/core
Migrating from Previous Releases
In order to avoid name collisions with the built-in JavaFX classes, we have undergone a fairly aggressive renaming strategy on all scene graph classes. If you have been using an earlier version of JFXtras, you will have to rename your usages by pre-pending an X before the class name. Going forward this will reduce the likelihood of collisions with JavaFX built-in classes and make it easier to visually inspect code that uses a mix of JavaFX and JFXtras classes.
Some other migration changes that you need to take into account include:
- The fill layout constraint has been changed from an enumeration to two booleans (hfill, vfill).
- The Grid border feature has been replaced with a general purpose margin on XLayoutInfo
- The Deck class has been renamed to XStack
- All the layout classes starting with Resizable* have changed to X* (when in doubt try the JavaFX class name prepended with an X)
JFXtras Test
There is also a matching release of JFXtras Test so you can do behavior-driven development with a declarative JavaFX syntax. We use this for all the unit tests in JFXtras and encourage you to do the same on your projects. Some of the new JFXtras Test features include:
- Asynchronous Testing Support – Test background processes such as HttpRequests
- JUnit Integration – Integrate JFXtras Test in your Ant or Maven build using a standard JUnit runner
Download it and give it at try!
Credits
Some of the folks I would like to thank for making this release possible include:
- Jim Weaver for inspiring me to start this project and being a great mentor.
- Keith Combs for assisting me on various bits and putting up with my perfectionism on everything.
- Jim Clarke for being the most productive JavaFX coder at Oracle who is not on the core team.
- Dean Iverson for bringing MigLayout to JFXtras and being the clean code guru (see his article on code conventions).
- David Armitage for contributing some great controls and making sure our documentation was top notch.
- Tom Eugelink for being our voice of sanity on the mailing list and being polite about my past mistakes in misattributing his work.
- Pedro Duque Vieira for making the world a safer place for Swing developers with JXScene.
- John Freeman for contributing a very high quality JTable wrapper that I always underpromote.
- And also: Peter Pilgrim, Christophe DUFOUR, Joshua Marinacci, Simon Morris, Andres Almiray, Jeff Friesen, Andrew Hughes, and Liu Huasong.




















Could you please provide a link to Dean’s article on code conventions.
Cheers, Eric
Here is a link: http://jfxtras.org/portal/core/-/wiki/JFXtras/Style_guidelines
Tor Norbye (of JavaFX Authoring Tool fame) also put together a set of JavaFX code conventions.
You can find them in wiki form here: http://wikis.sun.com/display/JavaFxCodeConv/Home
Also, great work on jfxtras project Steve plus others.
[...] Steve On Java Desenvolvimento, IDE, Plugin [...]
great work on jfxtras project . thanks to you and to jfxtras Team.
Actually I wrote similar code. But I didn’t encourage to share with you(jfxtras team) my code and ideas. Because i’m not a proffesional coder. I’m a dentist actually. I like play code, try my ideas etc. I like be an observer. But my code is similar your code. May be I must be more brave to share my code and ideas. And this my code without location interpolation :
public class MyLinearGradient extends LinearGradient, Interpolatable {
override public function ofTheWay(endVal: Object, t: Number): Object {
if (t == 0) {
this
} else if (t == 1) {
endVal
} else {
var srcStops: Stop[];
if (sizeof (endVal as MyLinearGradient).stops != sizeof this.stops) {
throw new RuntimeException(“target stops count not equal”);
}
for (stop in this.stops) {
insert {
Stop {
color: if (t < 1) stop.color.ofTheWay((endVal as MyLinearGradient).stops[indexof stop].color, t) as Color else (endVal as MyLinearGradient).stops[0].color
offset: stop.offset
}
} into srcStops;
}
LinearGradient {
startX: startX
startY: startY
endX: endX
endY: endY
stops: srcStops
};
}
}
}
Thanks for posting your code. If more than one person needed the same function then we must be doing something right.
By the way, if you are interested in contributing code in the future, please let me know. We are a very open community, and try to keep the barrier of entry to new contributors very low.
Thank you very much for this release!
That’s just what I’ve been missing in JavaFX!!!! I’m going to try the new DropDown component right now!
Great!
But is there any code examples of using this library? I am trying to create table reading only source code but it is really cumbersome :/
Michal,
There are examples for most of the JFXtras code either in the wiki or api docs (links in article). Controls are one area that there is a lot of active development in, so we do not have complete documentation for all of them yet.
The best way to learn how to use these controls is to look at the demos under the test folder of the distribution. I have also updated this blog entry to include links to the source code for all the samples. Here is the source for the XTableView example:
http://code.google.com/p/jfxtras/source/browse/controls/test/org/jfxtras/scene/control/XTableViewDemo.fx
One thing to note about the XTableView sample code is that we are using a custom ObjectDataProvider to dynamically generate an extremely large list. You can probably get away with a SequenceObjectDataProvider instead, which is the default if you set the rowType and rows variables like this:
XTableView {
rowType: FXLocal.getContext().makeClassRef(RowType.class)
rows: rowSequence
…
}
Hello,
Thx a lot for you answer I counld not find those code samples, or maybe I just did not search enough
Anyway – thank you.
That link is broken
We just switched to Mercurial, which broke old repository links.
I have updated the link to match the new repository structure.
I am trying to figure out how to get the scene to resize when embedding a JavaFX scene in a Java application. I am using “Javadocking” and I am trying to add a scene to a dockable JPanel. I have been able to do this except when I resize the JPanel (even in a simpler application without docking) either the stage or the scene is not resizing I am using the JFXtras “SceneToJComponent.loadScene” method.
Any help would be appreciated.
The best place to ask this question would be on the JFXtras User Mailing List:
http://groups.google.com/group/jfxtras-users
[...] capability was recently released as a part of the JFXtras 0.6 Release thanks to the hard work of Jeff Friesen, but is a very welcome addition to the core API! Now all [...]
Hi, i Launch the first example.
Everythings is exellent, except that when i maximize/restore/colse the window, it’s extremely slow. Taking about 10 seconds.
Windows XP/Firefox 3.5.9
Would you please find out why?
I am unable to reproduce this on my system. What version of Java are you running? (It should tell you at the top of the Java Console output, which you can enable in the Java Control Panel)
Mousewheel doesn’t work on the horizontal Thumb Nudge on XPicker demo. None the less, this is a superb library for JavaFX.
Does XTableView able to sort the column when clicked?
To do this with the current version you will need to do a little hacking in the source. If you change the order of the items in your model it will update the display order immediately, but adding the mouse listener on the column is a little tricky. This is definitely on the short list of features we want to add.
I have developed a project using jfxtras 0.5 and javafx 1.2, but yet I want to upgrade to javafx 1.3. Is it posible?? I`ve tried but I doesn’t know how to do it.
Hector,
We are working on a new release that is compatible with 1.3 now. Should be ready sometime next week.
hello. i am curious about the projectstate: “Our plan is to release a 1.3 compatible version of JFXtras within 1 week of the official release announcement from Oracle”. Can you publish some updates according the release date? thank you for a short answer.
We have the code compiling… working on fixing some issues. The current target is sometime next week.
thank you for your response! we were loooong waiting for javafx 1.3 and it came out in the last second for us. now we have to wait for a compatible jfxtra-version. our release schedule is very soon…
we are using only xmiglayout/xpicker/balloon-shape from jfxtras. so could we checkout the source and try to run our javafx1.3 with it the curren snapshot… bad idea or possible? that would give us the possiblilty to already upgrade our app from 1.2.3 to 1.3…
best regards. t.
I will prioritize getting those working first. I believe the balloon shape should be working. MigLayout may work (haven’t tested it). XPicker is the most difficult, because of all the control changes.
We finally got XMigLayout and XPicker both working thanks to Tom and David! The Shapes are all working as well. If you need this functionality now, feel free to build from source (branches/soma). Otherwise, I will put out a set of beta jars this weekend.
that would be very nice, thanks! i can wait for the balloon & xpicker till next week… (i just comment them out). for the xmiglayout it’s not that easy. it would be great if you can leave me a short message when you think we can have a try..
anyway thank you for the great work with jfxtras!! and anyway – i will list jfxtras and you in our soonly realesed software. please find more details about that in the url of my email…
best regars, t.
hello. do you know more about when releasing of jfxtras 0.7? could you provide a beta, for example? i would gladly test it thanks for short answer.
Steve, any idea when jxtras 0.7 will be released?
Thanks!
I am going to put out a beta tomorrow evening. Please try it and give us feedback so we can have a quality 0.7 release for JavaFX 1.3.
Steve, thanks for all your work.
Do you have an idea when the XTableView will be working for 1.3 ? We are using this for our Master Thesis and are not sure whether we should stay with 1.2.
Regards,
Roland
I am working on it. Definitely this week.
Hi Steve,
when will the SceneToJComponent work in your .7 beta for javafx 1.3 ? we really need this to work for our project
Pedro is taking a look into this. If you want the very latest info, follow the JFXtras-Dev mailing list.
[...] and must be included in JavaFX. If you are really in hurry and can use JavaFX 1.2, you can use XTableView from JFXtras. They are also working on 1.3 complaint version. If you want it to be part of official JavaFX [...]
Hi guys, what class is responsible for “SceneToJComponent” function in your 0.7 RC2.1 jar?
I’m sorry for this question, I’ve just found the answer on your blog
The link for the demo for xtable is not working:
http://code.google.com/p/jfxtras/source/browse/jfxtras.core/tags/release-0.6/controls/test/org/jfxtras/scene/control/XTableViewDemo.fx
OK, found the correct link on one of the replies for comments:
http://code.google.com/p/jfxtras/source/browse/controls/test/org/jfxtras/scene/control/XTableViewDemo.fx
Hi,i want to adjust cell width of xtableView,what should i do?,it has no variable ‘s name is wraptext?
my code
def xTableView = XTableView {
style: “-fx-base-color: red; -fx-accent-color: red;”
layoutInfo: LayoutInfo { height: 150 width: 350 }
columnDragging: false
dataProvider: ObjectDataProvider {
override var type = LiftBean{}.getJFXClass();
override bound function getItems(startIndex:Integer, count:Integer):Object[] {
for (i in [startIndex..startIndex+count-1]) {
var model = myLiftNew.installerLiftList.liftArray[(i + listOffsetInt) mod sizeof myLiftNew.installerLiftList.liftArray];
}
}
rowCount: myLiftNew.installerLiftList.liftArray.size()
};