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...]
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.
|
|
Top 10 Most Popular Articles in Current Issue (Vol 167, Issue 4)
|
|
|
|
|
Recent Blog Entries as of February 4, 2012, 10:24 am |
|
|
|
|
|
|