package pl.helion.j2mepp.lokalizator;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.TextField;

public class LogowanieForm extends Form {
    private TextField txtLogin = new TextField("Login:", "", 30, TextField.ANY);
    private TextField txtHaslo = new TextField("Hasło:", "", 30, TextField.PASSWORD);
    private Command cmdZaloguj = new Command("Zaloguj", Command.OK, 0);
    private Command cmdZarejestruj = new Command("Zarejestruj", Command.BACK, 0);

    public LogowanieForm(CommandListener l) {
        super("Logowanie");
        this.append(txtLogin);
        this.append(txtHaslo);
        this.addCommand(cmdZaloguj);
        this.addCommand(cmdZarejestruj);
        this.setCommandListener(l);
    }

    public String getLogin() {
        return txtLogin.getString();
    }

    public String getHaslo() {
        return txtHaslo.getString();
    }
}
