System News
Writing Skinnable Button Components for JavaFX
Sun Has Made Things Easier
April 22, 2009,
Volume 134, Issue 4

Writing skinnable button components for JavaFX now easier than before
 

Blogger javajeff wrote recently in JavaWorld on the subject of creating A skinnable button component for JavaFX. The author takes advantage of Sun's having provided the javafx.scene.control package, which circumvents a user's prior inability to change a component's appearance and/or behavior without rewriting the component.

There are two core classes, javajeff writes, in the javafx.scene.control package, which are:

  • The Control class, which subclasses CustomNode, provides the component's model.
  • The Skin class provides the component's look and feel.

The author notes that his aim in creating this particular blog was to overcome the lack of clarity in the JavaFX 1.1 documentation on Control and Skin. The blog post provides some insight into using these classes to create components beyond javafx.scene.control's TextBox class and specifically reveals a button component in terms of its Button model and ButtonSkin look and feel classes. It also demonstrates the use of this component with the textbox.

Procedures are provided for the creation of several classes:

  • The button model class
  • The ButtonSkin look and feel class
  • The DRC script's stage
  • The DRC script's model class

Acknowledging the difficulty of creating skinnable components, the author nevertheless announces his intention to present additional examples that complement the button component in future blog posts and solicits requests from readers wishing to see a favorite component implemented next. It is also possible, he concludes that Sun may provide additional skinnable components (and standardized support for themes, groups of logically related skins) in JavaFX 1.5.

More Information

JavaFX Technology at a Glance

Learning the JavaFX Script Programming Language

Skinning JavaFX API (Easier Than You Might Think) [...read more...]

Keywords:

fullsource
 

Other articles in the JavaFX section of Volume 134, Issue 4:
  • Writing Skinnable Button Components for JavaFX (this article)

See all archived articles in the JavaFX section.



News and Solutions for Users of Solaris, Java and Oracle's Sun hardware products
Just the news you need, none of what you don't – 42,000+ Members – 24,000+ Articles Published since 1998