// herbruikbare package

package be.styleit;

import java.awt.*;
import javax.swing.*;

public class H17_paginaUI extends JPanel {
	
	protected final static String labelNamen[] = { "Titel:","Keywoorden","Beschrijving","CSS-Bestand","Body kleur","Hoogte","Breedte" };
	
	protected JLabel labels[];
	protected JTextField velden[];
	protected JButton cmdAanmaken, cmdOpslaan;
	protected JPanel innerPanelCenter, innerPanelSouth;
	
	public void H17_paginaUI() {
		
		labels = new JLabel[7];
		velden = new JTextField[7];
		
		for (int teller=0;teller < labels.length; teller++)
			labels[teller] = new JLabel(labelNamen[teller]);
		
		for (int teller=0;teller < velden.length; teller++)
			velden[teller] = new JTextField();
		
		innerPanelCenter = new JPanel();
		innerPanelCenter.setLayout(new GridLayout(7,2));
		
		for (int teller=0;teller < labels.length; teller++) {
			innerPanelCenter.add(labels[teller]);
			innerPanelCenter.add(velden[teller]);
		}
		
		cmdAanmaken = new JButton();
		cmdOpslaan = new JButton();
		
		innerPanelSouth = new JPanel();
		innerPanelSouth.add(cmdAanmaken);
		innerPanelSouth.add(cmdOpslaan);
		
		setLayout(new BorderLayout());
		add(innerPanelCenter, BorderLayout.CENTER);
		add(innerPanelSouth, BorderLayout.SOUTH);
		
		validate();
	}
	
	public JButton getCmdAanmaken() {
		return cmdAanmaken;
	}
	
	public JButton getCmdOpslaan() {
		return cmdOpslaan;
	}
	

	public void setVeldNamen(String labelNamen[]) {
		for (int teller = 0; teller < labelNamen.length; teller++)
			velden[teller].setText(labelNamen[teller]);
	}

}
