• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the need for JavaFX?

 
Shantha Dodmane
Greenhorn
Posts: 18
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm completely new to javaFX. What is javaFX? What is the need for this technology? What it can do extra/differently which cannot be done using existing technologies?
 
Campbell Ritchie
Sheriff
Posts: 51332
86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know you can embed JavaFX in websites etc., and use it on mobile devices, but I would prefer to hear from somebody more experienced than myself.
 
Herb Schildt
Author
Ranch Hand
Posts: 253
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shantha,

JavaFX is Java's modern GUI framework. It offers a streamlined, yet powerful way to create graphical user interfaces. Its central metaphor is that of a stage and scene. Loosely speaking, a stage defines a space and a scene defines what goes in that space. Or, put another way, a stage can be thought of as a container for scenes, and a scene can be thought of as a container for items that comprise the scene.

As you are probably aware, the modern world demands dynamic, visually engaging interfaces. JavaFX makes it easy to add that "visual sparkle" to your applications. This can be achieved, for example, through the use of effects, transforms, and animation. In my view, JavaFX's support for animation – especially its ability to animate 3-D objects – is one of its most impressive features.

One last point: Having used several different GUIs in my programming career, I find JavaFX to be extraordinarily clear, consistent, and easy to use.
 
Winston Gutkowski
Bartender
Pie
Posts: 10571
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shantha Dodmane wrote:I'm completely new to javaFX. What is javaFX? What is the need for this technology? What it can do extra/differently which cannot be done using existing technologies?

Well I hate GUIs in general, but I have to say that FX struck me immediately as much more straightforward just by looking at the package docs.

And truly, anything's got to be an improvement on things like GridBagLayout, or old-fashioned drag-and drop logic. Has anyone ever written even a moderate Swing app in less than a thousand lines?

One thing I'd like to know: Does FX have a "named" components? - ie, a component with a right-justified name label to its left that is part of the component. It used to drive me nuts in Swing that I had to provide separate labels just to display the "name" (or title) of a component on a screen...

Winston
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is helpful in developing the application for mobile or TV.

Not really. Whatever the vision was when JavaFX first started off, it has not fulfilled that vision. Neither Android nor iOS nor Windows Mobile support JavaFX.

You can use it,if you're working with a graphic designer who is creating the appearance of the application in photoshop and you want to be able to import their look directly.

I'll have to disagree.
Photoshop generates PSD files. JavaFX doesn't support import of PSD files.
Perhaps you meant HTML files, but even those are not directly importable.
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:One thing I'd like to know: Does FX have a "named" components? - ie, a component with a right-justified name label to its left that is part of the component. It used to drive me nuts in Swing that I had to provide separate labels just to display the "name" (or title) of a component on a screen...

No such luck, Winston. The programming model is exactly the same - a layout and a static text label control for each form control.
Perhaps a custom implementation using a decorator pattern is possible, but one doesn't exist AFAIK.
 
John Damien Smith
Ranch Hand
Posts: 296
14
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Neither Android nor iOS nor Windows Mobile support JavaFX.

You can write JavaFX apps which execute on both Android and iOS (using JavaFXPorts: http://gluonhq.com/open-source/javafxports/).
I have never tried it, nor do I explicitly recommend it (developers need to make their own decisions on these kinds of things), but it is possible.
Recent news is that Android is moving to a library version based upon OpenJDK rather than Apache Harmony - it is yet to be determined if this will make JavaFX based development of Android apps more competitive with other development options on that platform.

> Does FX have a "named" components? - ie, a component with a right-justified name label to its left that is part of the component.

There is a Labeled superclass, which a few of the controls extend (e.g. labels, cells, titled panes, checkboxes, toggle buttons, etc). Labeled works by defining some text for the label and graphic, which is an arbitrary node that is placed relative to the text, e.g. to the left, to the right, above or below. Alignment of the text in the labeled is configurable, mnemonic parsing can be used in Windows to trigger the associated control, text can be elided due to space constraints, etc.

TextField's can have a prompt text associated. The default styling for TextFields is a gray text inside the control itself, such is often used in mobile apps - it is different from the Labeled behavior described above. There is not an in-built LabeledTextField in the core API, though it would be pretty straight-forward to create one or subclass Labeled to provide labeling functionality for other control types.

Third party libraries such as ControlsFX http://fxexperience.com/controlsfx/ and FXForm2 https://github.com/dooApp/FXForm2 contain similar functionality that extends the base APIs to label controls and also adds additional features such as validation support (which are not in the base APIs).
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops, sorry to all for my misleading reply and rank ignorance about the FX ecosystem.
That's some excellent info there from John, and now I can't wait to try out the FX Android port.
John, cow for you for a very informative answer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic