package com.adrienbrault.jastermind.client.ui;

import com.adrienbrault.jastermind.model.CodePeg;

import javax.swing.*;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author: adrienbrault
 * @Date: 04/06/11 16:33
 */
public class CodePegChoicesPanel extends JPanel {

    protected PegPanel[] pegPanels = new PegPanel[CodePeg.values().length];

    CodePegChoicesPanel() {
        JPanel container = new JPanel();
        for (int i=0; i<CodePeg.values().length; i++) {
            this.pegPanels[i] = new CodePegPanel(CodePeg.values()[i]);
System.out.println(this.pegPanels[i].getPreferredSize());
            container.add(this.pegPanels[i]);
        }
        this.add(container);
    }

    public PegPanel[] getPegPanels() {
        return pegPanels;
    }
}

@@ -113,16 +113,35 @@
 swing.*;
+%0Aimport java.awt.*;
 %0A%0A/**%0A *
@@ -392,40 +392,282 @@
     
-JPanel container = new JPanel();
+this.setBorder(BorderFactory.createLineBorder(Color.black,  2)); // 2px black border;%0A        this.setBackground(new Color(160, 82, 45)); // Brown.%0A%0A        JPanel container = new JPanel();%0A        this.add(container);%0A        container.setBackground(this.getBackground());%0A
 %0A   
@@ -794,65 +794,8 @@
 %5D);%0A
-System.out.println(this.pegPanels%5Bi%5D.getPreferredSize());
 %0A   
@@ -851,37 +851,8 @@
   %7D%0A
-        this.add(container);%0A
     

Update UI choices