Package view.forms

Source Code of view.forms.StadionForm

package view.forms;

import javax.swing.JTextField;

import view.Objectable;
import view.models.StadionTableModel;

import model.Stadion;

public class StadionForm extends Form<Stadion> implements Objectable<Stadion>{

  /**
   *
   */
  private static final long serialVersionUID = -4218269169663202279L;

  public StadionForm() {
    super(StadionTableModel.COLUMNS);
  }

  @Override
  public Stadion getObject() {
    Stadion stadion = new Stadion();
    stadion.setNazwa(((JTextField)textFields.get("nazwa")).getText());
    stadion.setMiejscowosc(((JTextField)textFields.get("miejscowosc")).getText());
    stadion.setUlica(((JTextField)textFields.get("ulica")).getText());
    stadion.setKod(((JTextField)textFields.get("kod")).getText());
    stadion.setNr(Integer.parseInt(((JTextField)textFields.get("nr")).getText()));
    return stadion;
  }

}
TOP

Related Classes of view.forms.StadionForm

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.