Monday Sep 10, 2012

Expressing the UI for Enterprise Applications with JavaFX 2.0 FXML - Part Two

A new article by Oracle’s Java Champion Jim Weaver, titled “Expressing the UI for Enterprise Applications with JavaFX 2.0 FXML -- Part Two,” now up on otn/java, shows developers how to leverage the power of the FX Markup Language to define the UI for enterprise applications. Weaver, the author of Pro JavaFX Platform, extends the SearchDemoFXML example used in Part One to include more concepts and techniques for creating an enterprise application using FXML.

Weaver concludes the article by summarizing its content, “FXML provides the ability to radically change the UI without modifying the controller. This task can be accomplished by loading different FXML documents, leveraging JavaFX cascading style sheets, and creating localized resource bundles. Named parameters can be used with these features to provide relevant information to an application at startup.”


Check out the article here.





Monday Jul 16, 2012

Introducing Groovy

Oracle developer Jim Driscoll has a new article up on otn/java, titled “Introducing Groovy,” that shows readers how to master the basics of Groovy, a general-purpose scripting language that runs on the Java Virtual Machine (JVM) – and, as Driscoll emphasizes -- one that can largely be viewed as a superset of Java.

He presents a “Hello World” program that can be understood as either a Java or Groovy program and will compile and run in either environment. Driscoll takes readers through the intricate connections and disconnects between Java and Groovy. For example, Groovy is public by default and “Groovy deals with String objects using double quotation marks with strings” which “allows for variable substitution”. And, “there are also strings with single quotation marks.”

Driscoll illustrates his points with copious code that illustrates how Java developers can tweak their own knowledge of Java to take advantage of Groovy’s strengths, so that, by the end of the article, the (Java-informed) reader more or less understands Groovy.

Check out the article here.

Wednesday May 23, 2012

Best Practices for JavaFX 2.0 Enterprise Applications, Part Two

Java Champion, Oracle Java Evangelist, and JavaFX expert Jim Weaver, has published Part Two of his article, "Best Practices for JavaFX 2.0 Enterprise Applications" on otn/java. Weaver continues to explore the possibilities of the TweetBrowser application, focusing now on new techniques and best practices that include:

* Leveraging a JavaFX cascading style sheet
* Implementing springs and struts in the UI
* Using a ternary operation in binding expressions
* Defining JavaFX properties
* Leveraging a Popup to implement a dialog box
* Using WebView to display a Web page

As Weaver emphasizes, there is a vast array of techniques and best practices that can be used in JavaFX applications. For example:

The JavaFX cascading style sheet (CSS) enables users to modify the appearance of an application.

The springs and struts concept enables a fixed horizontal strut and a variable horizontal spring so that an application can appear the way developers want it to appear, regardless of the size of the scene or the type of platform.

Go here to learn more about the rich possibilities of JavaFX 2.0 and enterprise applications.

Monday Apr 16, 2012

Best Practices for JavaFX 2.0 Enterprise Applications

A new article, up on otn/java, by Java Champion, Oracle Java Evangelist, and JavaFX expert Jim Weaver, titled "Best Practices for JavaFX 2.0 Enterprise Applications (Part One),” explores best practices for developing enterprise applications in JavaFX 2.0.

Weaver illustrates his points by examining a sample application named TweetBrowser which contains the following:

* “A Toolbar containing a TextField and a couple of Button controls for searching and navigating tweets obtained from the Twitter REST API.
* A ListView whose cells contain representations of the tweets. Each tweet is represented by a subclass of ListCell that contains an ImageView for the profile picture and Hyperlink controls that enable the user to navigate to screen names, hashtags, and Web links.
* A ProgressIndicator that spins when a search is performed and a WebView that displays the Web page associated with a Web link in a tweet.”

The TweetBrowser project, which Weaver invites the reader to download, contains the code for the application, portions of which he highlights throughout the article. Techniques and best practices used in the TweetBrowser application include:

    “Invoking an application via Java Web Start from the application’s home page
    Ensuring only one instance of the application is started
    Binding the UI to the model”

Weaver concludes the article by observing that, “Implementing techniques such as invoking an application via Java Web Start from the application’s home page, ensuring only one instance of the application is started, and binding the UI to the model make life easier for both the user and the developer."

Please stay tuned for Part Two of this series where Jim will explore more techniques and best practices used in the TweetBrowser example application.

You'll find Part One here.

Thursday Mar 01, 2012

Laying Out a User Interface with JavaFX 2.0

Java Champion and JavaFX expert Jim Weaver has a new article up on otn/java, titled “Laying Out a User Interface with JavaFX 2.0,” in which he shows developers how to use the layout capabilities of JavaFX 2.0 to make nodes in a scene graph appear where they belong and with the appropriate size.

He provides an overview of the LayoutSansTearsSolution application, shows how to make use of the SceneBuilder and BorderPaneBuilder classes, and helps readers understand the behavior of resizable nodes. Weaver explains the distinction between clamped and unbounded nodes and, finally, shows how to use CSS style sheet properties to modify the layout.

From the article:

“JavaFX has very powerful features for laying out a user interface... These features enable your applications to appear the way you want them to appear, regardless of the size of the scene or the type of platform. Understanding the behavior of each type of layout class, as well as concepts such as clamped versus unbounded nodes, will go a long way toward helping you make the UI appear exactly the way you want it.”

Read the complete article here.

Wednesday Jul 20, 2011

Using Transitions for Animation in Oracle’s JavaFX 2.0

A new article by Java Champion and JavaFX expert, Jim Weaver, titled “Using Transitions for Animation in Oracle’s JavaFX 2.0,” shows developers how to animate their nodes in scenes the easy way, using the JavaFX 2.0 TranslateTransition class. JavaFX comes with its own transition classes, whose purpose is to provide convenient ways to do commonly used animation tasks. The article shows how to use the TranslateTransition class to animate a node, moving it back and forth between two positions in the UI.

From the article:

“JavaFX 2.0 comes with several transition classes (that extend the Transition class) whose purpose is to animate visual nodes in your application. JavaFX also contains many builder classes that provide the ability to express a user interface in a declarative-style. In addition, JavaFX has a powerful property binding capability in which properties may be bound to expressions to automatically keep them updated.”

Read the article here.

About

Insider News from the Java Team at Oracle!

duke
javeone logo
Links


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
2
5
6
7
12
13
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today