Skip to main content

Blog Archive for malenkov during December 2008

Let's steal a car, repaint it, and do this quickly. What is more, do this in JavaFX and consider several programming hints by the way. 1. Steal a car. To start we need a car. It is not a problem with the car image available on web or located in the application. Image functionality is described in detail in the Image class overview. But what should we do, if the image is contained in another...
Every JavaFX node is able to process mouse movement events. Thanks to this ability the user can easily drag nodes on the scene or move windows. However, there are some nuances worth mentioning... It is very easy to create an application that could be dragged when you click on its contents. This feature is important for transparent windows and widgets which have no control elements provided by the...
It is typical to use absolute coordinates to position nodes in a simple JavaFX application. But what if your application becomes more complex? It is quite annoying to change the coordinates of several nodes if one of them changes its size. From Swing and AWT you can recall the mechanism of Layout Managers. Does JavaFX suggest anything similar? The JavaFX 1.0 API provides two simple subclasses of...
JavaFX has been released recently and now many beginners google on how to start programming. Let us consider a very simple example of drawing a clock face in JavaFX. First, draw a second hand. Pay attention to the position of the hand relative to the origin of coordinates, which will be used as a center of rotation. For example, rotate the hand by 60° (10 seconds).      ...
A PropertyEditor interface provides support for GUIs to enable editing a property value of a given type. The interface supports a variety of ways to display and update property values. One of these ways is to employ the string representation of a Java code fragment that can be obtained by getJavaInitializationString, the method all standard property editors implement. To test this feature, one...