/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JFverganadora.java
 *
 * Created on 20-jul-2010, 15:56:44
 */

package vistas;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Adrian
 */
public class JFverganadora extends javax.swing.JFrame {

    public JFprincipal p = new JFprincipal();

    /** Creates new form JFverganadora */
    public JFverganadora() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        n1 = new javax.swing.JLabel();
        n2 = new javax.swing.JLabel();
        n3 = new javax.swing.JLabel();
        n4 = new javax.swing.JLabel();
        n5 = new javax.swing.JLabel();
        n6 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowActivated(java.awt.event.WindowEvent evt) {
                formWindowActivated(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel1.setText("La combinacion ganadora es:");

        n1.setFont(new java.awt.Font("Tahoma", 0, 24));
        n1.setForeground(new java.awt.Color(0, 102, 0));
        n1.setText("23");

        n2.setFont(new java.awt.Font("Tahoma", 0, 24));
        n2.setForeground(new java.awt.Color(0, 102, 0));
        n2.setText("23");

        n3.setFont(new java.awt.Font("Tahoma", 0, 24));
        n3.setForeground(new java.awt.Color(0, 102, 0));
        n3.setText("23");

        n4.setFont(new java.awt.Font("Tahoma", 0, 24));
        n4.setForeground(new java.awt.Color(0, 102, 0));
        n4.setText("23");

        n5.setFont(new java.awt.Font("Tahoma", 0, 24));
        n5.setForeground(new java.awt.Color(0, 102, 0));
        n5.setText("23");

        n6.setFont(new java.awt.Font("Tahoma", 0, 24));
        n6.setForeground(new java.awt.Color(0, 102, 0));
        n6.setText("23");

        jButton1.setText("Aceptar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabel2.setForeground(new java.awt.Color(0, 102, 0));
        jLabel2.setText("__________________________________");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1))
            .addGroup(layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addComponent(n1)
                .addGap(29, 29, 29)
                .addComponent(n2)
                .addGap(34, 34, 34)
                .addComponent(n3)
                .addGap(35, 35, 35)
                .addComponent(n4)
                .addGap(41, 41, 41)
                .addComponent(n5)
                .addGap(33, 33, 33)
                .addComponent(n6))
            .addGroup(layout.createSequentialGroup()
                .addGap(149, 149, 149)
                .addComponent(jButton1))
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n1)
                    .addComponent(n3)
                    .addComponent(n4)
                    .addComponent(n2)
                    .addComponent(n5)
                    .addComponent(n6))
                .addGap(18, 18, 18)
                .addComponent(jButton1)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    //Boton aceptar
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    //Cuando el formulario se activa
    private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
        // TODO add your handling code here:
        List <Integer> gan = new ArrayList();
        gan = p.cliente.getGanadora(); //Cojemos la ganadora
        n1.setText(gan.get(0).toString()); //La mostramos en los text
        n2.setText(gan.get(1).toString());
        n3.setText(gan.get(2).toString());
        n4.setText(gan.get(3).toString());
        n5.setText(gan.get(4).toString());
        n6.setText(gan.get(5).toString());
    }//GEN-LAST:event_formWindowActivated

    /**
    * @param args the command line arguments
    */
    /*public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JFverganadora().setVisible(true);
            }
        });
    }*/

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel n1;
    private javax.swing.JLabel n2;
    private javax.swing.JLabel n3;
    private javax.swing.JLabel n4;
    private javax.swing.JLabel n5;
    private javax.swing.JLabel n6;
    // End of variables declaration//GEN-END:variables

}
