TextBox tx = new TextBox("", "", 10, 0); tx.setCommandListener(объект класса, который implements CommandListener);
public void commandAction(Coomand c, Displayable d){ if(d==tx){....}