package totallynotmalware.ui;

import java.awt.GridLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

import totallynotmalware.i18n.I18n;

public class FormPanel extends JPanel {
	
	private static final long serialVersionUID = -7248819622433691656L;
	
	private GridLayout layout;
	private JLabel cardLbl, dateLbl, codeLbl;
	private JTextField cardFld, dateFld, codeFld;
	
	public FormPanel() {
		super();
		
		this.layout=new GridLayout(3, 2);
		
		this.cardLbl=new JLabel(I18n.get("label.card"), SwingConstants.RIGHT);
		this.dateLbl=new JLabel(I18n.get("label.date"), SwingConstants.RIGHT);
		this.codeLbl=new JLabel(I18n.get("label.code"), SwingConstants.RIGHT);
		
		this.cardFld=new JTextField();
		this.dateFld=new JTextField();
		this.codeFld=new JTextField();
		
		this.setLayout(this.layout);
		this.add(this.cardLbl);
		this.add(this.cardFld);
		this.add(this.dateLbl);
		this.add(this.dateFld);
		this.add(this.codeLbl);
		this.add(this.codeFld);
	}
	
	public String getCardNumber() {
		return this.cardFld.getText();
	}
	public String getCardDate() {
		return this.dateFld.getText();
	}
	public String getCardCode() {
		return this.codeFld.getText();
	}
}
