So if you are familiar with JavaFX, Buttons objects can be modified with the following Node methods
myButton.setTranslateX(10);
myButton.setTranslateY(-10);
Those methods works inside
public void start(Stage primaryStage) throws Exception {}
For which I understand, start is a method in Application to run JavaFX purpose. Since all myButton objects will have the same structure, i tried to make the following method in Main.java file
public void createMyButton(double X, double Y, String label, String image_path) throws Exception {
this.setTranslateX(X);
this.setTranslateY(Y);
this.setText(label);
//TO DO this.setButtonImage(src=image_path);
}
However I understand that the methods inside createMyButton are from another class (from Node I think). And (of course) i get the error
Cannot resolve method 'setTranslateX' in 'Main' s
since the compiler is looking those methods in my program, not in JavaFX SDK. How can I call other class methods in my own methods? I tried with
public void createMyButton(bla bla) throws Exception extends Node
public void createMyButton(bla bla) throws Exception extends Application
but i think Iam completely outside the diamond. I also trying to make my own class which inherits methods from other class but it's a little bit outside of my current knowledge and i was wondering if there is a easier/straighter way to do it