Sergio
Sergio

Reputation: 8670

javabeans browsing component for javafx?

I would like to include in the GUI of certain javafx application a JavaBeans browser. I mean, something that receives as input a collection of objects following the JavaBeans convention and allows to inspect their properties in a tree list. Does such a thing exist for Javafx ? or at least for Swing ?

Upvotes: 1

Views: 167

Answers (1)

jewelsea
jewelsea

Reputation: 159466

While I'm sure such components exist for Swing, I'll restrict my answer to a discussion of a potential JavaFX based solution.

It is possible to implement a JavaBeans browsing component with JavaFX, but it would be some work and there is no off the shelf component that does this that I know of.

A solution which only does browsing is going to be simpler to build than one which also allows editing or two way reflection of property values.

A starting point for a JavaFX based solution might be the 3rd party DataFX project which mentions the ability to use java beans as a "data source".

The JavaFX SceneBuilder application must do this kind of thing internally, but unfortunately it is not open source.

Another similar application you could look at it is ScenicView, which should include code that implements the kind of property browsing introspection you are seeking. ScenicView may be open source. I'd suggest asking the program authors for the source as adapting some of it's code would likely save you lots of time rather than trying to build a similar solution yourself. If you could take ScenicView from being a SceneGraph specific tool to being a generic object browser that is embeddable in another application, that would be very nice . . .

A screenshot of the JavaFX ScenicView application: scenicview

Another useful resource for a simplistic solution would be this post:

How to create Property Editor with Listview / Tableview

Upvotes: 1

Related Questions