I've mentioned how simple, elegant and powerful JavaFX Script is. Here's a perfect example of these three qualities. A few weeks ago I wanted to show a progress indicator in a multi-tier application that has a rich client developed in JavaFX Script. Whenever the client is waiting for a response from the server, I wanted to show this progress indicator.
The screenshot above shows the InfiniteProgressPanel widget that I used from the JavaFX Script UI library. It was invented by Romain Guy, a co-author of the book Filthy Rich Clients. It is a great alternative to a progress bar due to the fact that you don't have to continually calculate what percent complete the operation is. This is because the progress bar is circular (and therefore infinite). In addition, it is very easy to use: You just place the InfiniteProgressPanel in the UI containment hierarchy, and bind its progress attribute to a Boolean variable that is true whenever you want the progress indicator to appear. Here's the code for this compiled JavaFX Script example:
/*
* CompiledInfiniteProgress.fx
*
* Developed 2007 by James L. Weaver (jim.weaver at lat-inc.com)
* to serve as a compiled JavaFX Script example.
*/
import javafx.ui.*;
import java.lang.System;
Frame {
var busy = false
title: "Infinite Progress Panel Demo"
width: 400
height: 400
background: Color.WHITE
visible: true
onClose:
function() {
System.exit(0);
}
content:
InfiniteProgressPanel {
progress: bind busy
content:
FlowPanel {
content: [
Button {
text: "Get Busy"
action:
function() {
busy = true;
ConfirmDialog {
title: "Patience is a Virtue"
message: "Simulating a busy condition"
visible:true
onYes:
function() {
busy = false
}
};
}
}
]
}
}
}
Please compile and run this example and try it out for yourself! When you click the Get Busy button, the confirmation dialog will be displayed and the infinite progress indicator will appear. When you dismiss the dialog by clicking the OK button, the progress indicator will disappear.
By the way, the next several posts are going to highlight various UI widgets similar to the way this post does. I'd like to give you an appreciation of the rich set of widgets available in JavaFX Script, and how easy they are to use.
JavaFX Script Boot Camp Announcement
As a heads-up, I will be offering a JavaFX Script 2.5 day "boot camp" on Wednesday, April 9 through Friday, April 11, 2008 (ending at noon) in Indianapolis, Indiana. This course is designed to get you quickly up to speed in JavaFX Script application development. A primary reference for this course is my JavaFX Script book, but the course has its own syllabus which includes material covered in the book as well as up to the minute developments in compiled JavaFX Script. Registration will open soon, and for this pilot class I am accepting 12 students. The cost of this pilot class will be 900 USD per student. Additional students from the same organization will be 600 USD. You'll need to bring your laptop computer with the latest versions of the JavaFX Script downloads (which I'll specify in more detail as the class date approaches). The prerequisite for the class will be the completion of a JavaFX Script programming assignment that I'll post soon to this weblog. I'm looking forward to teaching this class and hope that you can attend!
More details to follow,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
Immediate eBook (PDF) download available at the book's Apress site
An intriguing question is whether infinity exists in our physical universe: Are there an infinite number of stars? Does the universe have infinite volume? Does space "go on forever"? This is an important open question of cosmology. Note that the question of being infinite is logically separate from the question of having boundaries. The two-dimensional surface of the Earth, for example, is finite, yet has no edge.
Posted by: buy generic viagra | April 27, 2010 at 05:06 PM
Disclaimer out of the way, most of these I just conjured up from my
head and if you need a link on a particular mention, shoot me a
clarification and I'll be happy to run anything down for you. I
included quite a few for luck, drawing and keeping wealth, protection.
etc.
Posted by: generic propecia | April 26, 2010 at 11:02 AM
Thanks for this info, i tried your post and it run more or less ok. But thanks anyway, it is always a pleasure to learn.
Posted by: Paneles Solares | March 20, 2009 at 10:44 PM
Alex,
Thanks for your kind words. As I stated in this post, I plan to show code examples of UI widgets in the next few posts. Do you feel like that is what you and many other readers of this weblog would like to see? Are there other JavaFX-related topics that you'd like me to blog about?
Thanks,
Jim Weaver
Posted by: Jim Weaver | January 09, 2008 at 09:31 AM