the code will show you what im trying to do, I hope you understand
im new to programming but know the basics of java and im trying to add Object Oriented Programming to my apps so its not procedural
thanks , if you need more info to understand just ask me.
package myApp;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage myStage) throws Exception
{
VBox root = new VBox();
Scene scene = new Scene(root);
myStage.setScene(scene);
myStage.show();
Button btn = new Button("Click Me");
root.getChildren().add(btn);
bank yo = new bank();
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
bank.customer();
}
});
}
public static void main(String[] args) {
Application.launch(args);
}
}
package myApp;
import javafx.scene.control.Button;
public class bank
{
public static void customer()
{
btn.setText("yo");
}
}