Friday Feb 03, 2012

Building Applications in JavaFX 2.0

In a new tech article up on otn/java, adapted from a series of innovative blog postings, Downstream's Senior Java Architect Daniel Zwolenski develops ways to build apps in JavaFX 2.0 -- from Spring to controller injection to client servers. The article is derived from several blogs wherein he explores ways to create applications in JavaFX 2.0, building upon a direct port of Oracle Chief Client Java Architect Richard Bair’s FXML+Guice dependency injection example into Spring.

As Zwolenski says, “Many developers still believe that Spring is all about XML configuration files, but it has evolved a lot since the early days. I’m going to use Spring’s annotation-based configuration to create a pure Java example (i.e., zero Spring XML) that looks almost identical to the Guice one.”

Zwolenski is the creator of JFX Flow which he describes as, “a free, open source framework for developing rich, interactive and user friendly web-style GUIs for desktops using JavaFX (2.0+). JFX Flow combines the powerful feature set of JavaFX (styling, animations, FXML, etc.) with a simple ‘web flow’ style framework that is easy to use and that fosters clean architectural patterns, especially when developing Java EE applications. JFX Flow is currently in Alpha release and may still have some bugs. The core framework is usable however, and the API is quite stable.”

Read the complete article here.


Wednesday Dec 21, 2011

Updating Java ME Applications

A new article up on otn/java, by Java ME expert Vikram Goyal, titled “Updating Java ME Applications,” demonstrates how easy it is to update the text, images, and source code for Java ME applications. Goyal explains that updating a Java ME application includes updating static data, such as text and images, as well as code components of the application. In the article, he develops a sample app that illustrates how to update an application.

As Goyal explains, “The article starts with the basics—updating simple text strings—and then moves to updating images. Finally, the article shows the easiest way to update the core application files, which Java ME makes quite easy. However, this ease can come at a price in terms of extra network traffic.”

Goyal concludes the article with some basic advice:

“If you don’t need to update the entire source code for your application, use the connection classes provided within the javax.io package, such as ContentConnection and HttpConnection, to update static data, such as text and images.

On the other hand, if you need to provide a mechanism for updating the entire source code, make sure you follow a valid update process on the server, and use platformRequest(String) with a URL that ends in jad to provide the updates. The device’s interface will then make sure the updates are applied by removing the old MIDlet and installing the new updated version.”

Read the complete article here.



Monday Oct 17, 2011

JavaFX 2.0 Arrives and is Open Sourced

JavafxAmong the big news at JavaOne 2011 was the release of JavaFX 2.0 and announcement of its open source status. As Oracle’s Chief Architect, Client Java Platform Richard Bair observed, “We think this is going to be a really big deal in the industry.” JavaFX 2.0, touted as the next step in the evolution of Java as a rich client platform, is designed to provide a modern Java environment that shortens development time and eases the deployment of data driven-business and enterprise client applications.

 

Its key features include:

 

• Java APIs for JavaFX

 

• FXML -- an XML-based markup language for defining user interfaces

 

• Seamless integration into Swing applications

 

• High-performance hardware accelerated graphics

 

• Embedding of web content into JavaFX

 

• High-performance media engine

 

• Improved UI controls library

 

JavaFX 2.0 enables developers to leverage their existing Java skills and tools to develop JavaFX applications. It offers a clean separation of application UI and logic and simplifies code maintenance while integrating Web content and media seamlessly in Java applications. Developers can more easily create scalable, graphics-rich applications without performance penalties, build sophisticated user interfaces, extend existing Swing applications, and deploy applications in the browser, as desktop, or Web Start applications.

 

Java APIs for JavaFX include:

 

• End-to-end Java development

 

• Java language features—generics, annotations, multi-threading

 

• Reduced static footprint of runtime and applications

 

• Fluent API design for UI construction

 

• Development in alternative languages (e.g., JRuby, Groovy) with JavaFX

 

• Leverage sophisticated Java IDEs, debuggers and profilers

 

• Java APIs preserve convenient JavaFX Script features (e.g., bind)

 

Other features to take note of in JavaFX 2.0:

 

FXML

 

• Scriptable, XML-based markup language for defining user interfaces

 

• Convenient alternative to developing UI programmatically in Java

 

• Easy to learn and intuitive for developers familiar with web technologies or other markup based UI technologies

 

• Powerful scripting feature allows embedding scripts within a FXML file. Any JVM scripting language can be used, including JavaScript, Groovy, and Clojure, among others

 

New Graphics Pipeline for Modern GPUs

 

• New hardware accelerated graphics pipeline (Prism)

 

• New windowing toolkit (Glass) for Prism

 

• Java2D software pipeline for unsupported graphics hardware

 

• High-level support for making rich graphics simple: Shadows, Blurs, Reflections, Effects, 2D and 3D transforms

 

 

Rich Set of UI Controls

 

• Over 50 components for form-based UI, including charts, layout and form controls

 

• CSS3+ skinning and layout of UI controls

 

• Advanced UI controls, including table, tree view, rich text editor

 

 

Web Component

 

• Embed Web content in JavaFX applications

 

• HTML and JavaScript rendering based on Webkit

 

• DOM access and manipulation from Java

 

 

Browser Plug-in Refreshed for JavaFX 2.0

 

• Loading of JavaFX applets based on Prism

 

• Preloader for JavaFX applets for improved user experience

 

 

Powerful Properties Model

 

• New collections ObservableList, Sequence and ObservableMap

 

• New design and implementation of bean properties

 

• Low level binding API for high performance, low footprint bindings

 

• High level binding API for simple usage

 

 

Improved Animation Engine

 

• Optimized implementation of transitions

 

• Complete overhaul of API to simplify usage and in preparation of optimized and more stable implementation

 

 

Approximately 50 JavaFX 2.0 sessions can be found at JavaOne given by leading JavaFX movers and shakers. JavaFX is the next step in the evolution of Java as a rich client platform. Congratulations to all involved!  


Wednesday Sep 21, 2011

Experts from Oracle and the Community at Silicon Valley Code Camp!

Silicon Valley Code Camp (Oct. 8 & 9) is a community-driven developer conference. Developers will learn from their fellow developers in 212 sessions about code, of course, but also about legal issues, branding and community building. Experts from Oracle and the community are sharing their technical know-how during those 2 days in session formats ranging from informal discussions to presentations.

Conveniently scheduled on the weekend with a free entrance, the conference has become more popular over the years and has 1,787 registered this year. The support of many sponsors makes this conference happen and this year Oracle is a platinum sponsor.


Oracle Experts

Pieter Humphrey

In-memory session replication with WebLogic and GlassFish, Coherence 

http://blogs.oracle.com/devtools

Sun., Oct. 9 –  10:45am  

An engineer's introduction to in-memory data grid development

http://blogs.oracle.com/devtools

Sun., Oct. 9 – 9:15am


Patrick Curran

JCP and the Future of Java

http://htp://jcp.org

Sun., Oct. 9– 9:45am


Juan Camilo Ruiz

Extending the JSF controller for reusability

Sun., Oct. 9 - 2:45pm


Arun Gupta

The Java EE 7 Platform: Developing for the Cloud

http://blogs.sun.com/arungupta

Sat., Oct. 8 - 11:15am

Deploy and Monitor your Java EE 6 session in a fully-clustered GlassFish

http://blogs.sun.com/arungupta

Sat., Oct. 8 - 9:45pm


Todd Farmer

Building Java Applications for MySQL

Sun., Oct. 9h – 1:15pm


Simon Law

High-Performance SQL Applications Using In-Memory Database Technology

Sun., Oct. 9h –  10:45am

Experts from the Community

Stephen Chin

JavaFX 2.0 With Alternative Languages-

Groovy, Clojure, Scala, Fantom, and Visage

http://steveonjava.com/

Sat., Oct. 8h – 11:15am


John David Duncan

MySQL Cluster With and Without SQL

http://mysqlblog.lenoxway.net

Sat., Oct. 8h – 1:45pm


Peter Pilgrim

Progressive Enhanced JavaFX 2.0 Custom Components

http://www.xenonique.co.uk/blog/

Sat., Oct. 8th – 5:00pm


Prashant Deva

Chronon - DVR for Java

http://www.chrononsystems.com

Sat., Oct. 8h – 11:15am


Slava Imeshev

Best Practices for Scaling Java Applications

with Distributed Caching

http://www.cacheonix.com

Sun., Oct. 9h – 1:15pm


Manish Pandit

Play! as you REST : Using Play! Framework

to build RESTful services

http://twitter.com/lobster1234

Sat., Oct. 8th – 1:45pm





Wednesday Sep 07, 2011

Unit Testing for Java EE tech article on OTN

A new article, titled “Unit Testing for Java EE,” by Java Champion Adam Bien, is up on otn/java’s front page. Bien points out that too many developers believe that testing Java EE applications is too hard, inconvenient, or complex, something that has not been true since the advent of Java EE 5 more than five years ago.

Bien explains: “There is nothing special about unit testing Java EE 6 applications. You only have to add the JUnit library into your pom.xml file (see Listing 5) and put your classes into the src/test/java directory. All JUnit tests will be executed automatically during the standard Maven lifecycle: mvn clean install.”

He goes on to make use of “Mockito” an easy-to-use, open source mocking library. Bien writes:

“Mockito is able to create ‘smart proxies’ (a.k.a. mocks) from classes or interfaces. These proxies do not come with any behavior, but they are still perfectly usable. You can invoke methods, but will get the default values, or null, back. The behavior of the mocks can be recorded after their creation with when(mock.getAnswer()).then(42) syntax.

Mockito is perfectly suitable for ‘simulating’ any inconvenient classes, resources, or services. You can start with Mockito just by knowing a single class org.mockito.Mockito. The when-then ‘domain specific language’ is composed of static methods from the Mockito class. The org.mockito.Mockito class is well documented. In fact, the whole documentation set was generated from the JavaDoc markup in the org.mockito.Mockito class.”

Read the complete article here.

Tuesday Jun 28, 2011

A Method for Reducing Contention and Overhead in Worker Queues for Multithreaded Java Applications

A java.net article, rich in practical resources, by IBM India Labs’ Sathiskumar Palaniappan, Kavitha Varadarajan, and Jayashree Viswanathan, explores the challenge of writing code in a way that that effectively makes use of the resources of modern multicore processors and multiprocessor servers.

As the article states:

“Many server applications, such as Web servers, application servers, database servers, file servers, and mail servers, maintain worker queues and thread pools to handle large numbers of short tasks that arrive from remote sources. In general, a ‘worker queue’ holds all the short tasks that need to be executed, and the threads in the thread pool retrieve the tasks from the worker queue and complete the tasks.

Since multiple threads act on the worker queue, adding tasks to and deleting tasks from the worker queue needs to be synchronized, which introduces contention in the worker queue.”

The article goes on to explain ways that developers can reduce contention by maintaining one queue per thread. It also demonstrates a work-stealing technique that helps in effectively utilizing the CPU in multicore systems.

Read the rest of 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