ShortcutListener on Multiple TextFields question

I’m kind of new to all this.
I have 2 TextFields.
public TextField t1 = new TextField();
public TextField t2 = new TextField();

I have 1 shortcutListener
ShortcutListener enter = new ShortcutListener(“enter”,
KeyCode.ENTER, null) {
@Override
public void handleAction(Object sender, Object target) {
///HOW DO I CHECK WITCH TextField CALLED IT
///something like
if(t1){
DO SOMETHING
}else{
DO SOMETHING ELSE
}

 }

};
t1.addShortcutListener(enter);
t2.addShortcutListener(enter);

I can’t figure out from what Object (sender,target) I have to take what info.

If you put a breakpoint inside the handleAction method you can see that the Object target is in this case in fact of type TextField, while the Object sender is your UI. So just if (t1.equals(target)) {…} should do the trick.

Thanks Anna.