0

I'm trying to make a quite complex UI using javaFX scene builder. The UI has lots of objects (e.g. buttons) with similar functionalities and I want to use instances of subclasses of that javaFX classes (e.g. MyButton) that support those functionalities. For example I have about 30-40 buttons which all should type "blah blah" in the event of clicking. I'd like to make a subclass of Button named Mybutton which does that and use it's instances instead of adding this functionality to each one of those buttons. I've tried to import those classes as a .jar file into scene builder for a couple of times but each time I get this : It's all i get Is it possible at all to import subclasses of javaFX classes and to use them in scene builder? and if the answer is no what are my other options?

Community
  • 1
  • 1
moeen.n
  • 70
  • 4
  • This is possible. Can you post an outline (remove any specific implementation details) of your MyButton class? – Michael Dec 06 '16 at 16:47
  • See http://stackoverflow.com/questions/30063792/adding-a-custom-component-to-scenebuilder-2-0 Are you placing any of your custom classes in the default package? SceneBuilder will not work with that (and it is bad practice anyway). – James_D Dec 06 '16 at 16:48
  • See also: [How to create an FXML file for an already created new component in java than add it to scene builder?](http://stackoverflow.com/questions/29444698/how-to-create-an-fxml-file-for-an-already-created-new-component-in-java-than-add) – jewelsea Dec 06 '16 at 19:45

0 Answers0