I am sitting with a little problem here, and i has been searching for hours for any soultion now, but cant seem to find any, and i hope you can help me.

I have these methods:

```java
public String getInput(){
    //Wait here somehow
    return "Whatever to return";
}

public void keyTrigger(KeyEvent event){
    if(event.getCode().equals(KeyCode.ENTER)){
        String[] getInput = gameLog.getText().split("\n");
            input = getInput[getInput.length - 1]; //Input is a variable in the class
            //Tell the getInput() to continue from where i waited
    }
}

```

So if anyone can tell me how the make the first method wait for a response from the other method, i woul be very happy, because none i have tried so far has worked

EDIT...
Sorry guys, i have missed out on some details. 

1st: I am developing a GUI in JavaFX, and the gameLog variable is a textarea, and thats why im splitting the String on linebreaks. 

2nd: when i call getInput() i want it to wait for the user to press enter, then get the input variable