mardi 23 juin 2020

How to add text to Canvas from a different Class?

I have a JavaFX project in which I have a controller class a main class and other classes I have a Canvas in the controller class that I want to print on it the output of a function (.getvalue) in a different class "Interpreter":

public class Interpreter implements Runnable {

@Override
public void run() {}

private void interpret(ArrayList<Element> AST) {
    for (Element element : AST) {
        switch (element.getType()) {
            case "string":
                ((Str) element).getValue();
                break;
            case "number":
               ((Num) element).getValue();
                break; ...........}

what I want to print on the Canvas is .getValue(); output What suggestion can you give me, please note that I cant change the code in interpreter because the output will get messed up




Aucun commentaire:

Enregistrer un commentaire