File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JavaFX and the fly likes create custom component in javaFX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "create custom component in javaFX" Watch "create custom component in javaFX" New topic
Author

create custom component in javaFX

Liviu Dorneanu
Greenhorn

Joined: May 29, 2012
Posts: 2
Hi there!

I'm new at JavaFX, i'm just starting to learn it and I runned into a problem.
I need to create a custom component in JavaFX (using fxml).
Long story short: I have a application for witch I will have a "part" that will be common for most of the "scenes" ("pages"). This part should contain a menu, a logo, some labels, 2-3 buttons, etc., and I should be able to populate some of the labels based on some data. This is why I thought that I better create a custom component and use it on all my pages (scenes). The problem is that I did not found information about creating custom components (I don't need a custom control, a button, label or something like this..., I need a custom component) over the internet.
Could you please tell me if this is possible? I mean is these a way to create custom components using JavaFX?
Could this component act as a controller (set properties, get values ... )?
Can you help me with some documentation?

Thank you in advance!
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4542
    
    5

Please BeForthrightWhenCrossPostingToOtherSites
http://forums.codeguru.com/showthread.php?p=2069190


luck, db
There are no new questions, but there may be new answers.
Liviu Dorneanu
Greenhorn

Joined: May 29, 2012
Posts: 2
Yep ... sorry about that ... I did not know the "Be Forthright When Cross Posting To Other Sites" rule ... I have posted this question a few days ago on only one forum, and because I did not got an answer ... I thought it would be better to post on a few more.

I still don't have an answer!

Thank you!
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4542
    
    5

You don't really need a custom component (and component is an old AWT concept anyways; FX doesn't have components). All you need is a method that returns any suitable Parent subclass populated with the requisite Nodes.

Could this component act as a controller (set properties, get values ... )?

The real question is not could it, but should it? And only you have sufficient knowledge of the design to answer that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: create custom component in javaFX