/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package mat;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.util.Scanner;

/**
 *
 * @author samuel
 */
public class tela4 extends javax.swing.JFrame {

    /**
     * Creates new form tela4
     */
    public tela4() {
        initComponents();
          centralizarComponente();
          q7.setVisible(true);
        q7.setEditable(false);
        centralizarComponente();
          
          
    }
    public void centralizarComponente() {
        Dimension ds = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension dw = getSize();
        setLocation((ds.width - dw.width) / 2, (ds.height - dw.height) / 2);
    }

    /**
     * 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() {

        jLabel9 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        q1 = new javax.swing.JTextField();
        q7 = new javax.swing.JTextField();
        jButton3 = new javax.swing.JButton();
        q2 = new javax.swing.JTextField();
        q3 = new javax.swing.JTextField();
        q4 = new javax.swing.JTextField();
        q5 = new javax.swing.JTextField();
        q6 = new javax.swing.JTextField();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jLabel13 = new javax.swing.JLabel();
        jButton8 = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();

        jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGEM/newpackage/ok.png"))); // NOI18N

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(null);

        jButton2.setFont(new java.awt.Font("Noto Sans", 0, 18)); // NOI18N
        jButton2.setText("Menu");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton2);
        jButton2.setBounds(50, 680, 104, 40);

        jLabel6.setFont(new java.awt.Font("Century Schoolbook L", 1, 24)); // NOI18N
        jLabel6.setText("Pontos Feitos no torneio");
        getContentPane().add(jLabel6);
        jLabel6.setBounds(40, 300, 587, 52);

        jLabel11.setFont(new java.awt.Font("Century Schoolbook L", 1, 24)); // NOI18N
        jLabel11.setText("Qualidade dos proximos adversarios");
        getContentPane().add(jLabel11);
        jLabel11.setBounds(40, 350, 587, 52);

        jLabel5.setFont(new java.awt.Font("Century Schoolbook L", 1, 24)); // NOI18N
        jLabel5.setText("Jogos Restantes");
        getContentPane().add(jLabel5);
        jLabel5.setBounds(40, 450, 632, 38);

        jLabel1.setFont(new java.awt.Font("Century Schoolbook L", 1, 24)); // NOI18N
        jLabel1.setText("Qualidade do Elenco");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(40, 250, 510, 48);

        jLabel12.setFont(new java.awt.Font("Century Schoolbook L", 1, 24)); // NOI18N
        jLabel12.setText("Quantidade Pontos restantes");
        getContentPane().add(jLabel12);
        jLabel12.setBounds(40, 400, 510, 48);

        jLabel2.setFont(new java.awt.Font("Century Schoolbook L", 1, 24)); // NOI18N
        jLabel2.setText("Forca da equipe entre 1 - 100");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(40, 200, 587, 52);

        jLabel3.setFont(new java.awt.Font("Century Schoolbook L", 1, 24)); // NOI18N
        jLabel3.setForeground(new java.awt.Color(215, 17, 19));
        jLabel3.setText("Probabilidade é:");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(230, 510, 281, 47);

        q1.setFont(new java.awt.Font("Noto Sans", 1, 14)); // NOI18N
        q1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                q1ActionPerformed(evt);
            }
        });
        getContentPane().add(q1);
        q1.setBounds(630, 190, 110, 40);
        getContentPane().add(q7);
        q7.setBounds(190, 550, 326, 47);

        jButton3.setFont(new java.awt.Font("Noto Sans", 1, 14)); // NOI18N
        jButton3.setText("Calcular");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton3);
        jButton3.setBounds(620, 550, 110, 44);

        q2.setFont(new java.awt.Font("Noto Sans", 1, 14)); // NOI18N
        q2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                q2ActionPerformed(evt);
            }
        });
        getContentPane().add(q2);
        q2.setBounds(630, 240, 110, 40);

        q3.setFont(new java.awt.Font("Noto Sans", 1, 14)); // NOI18N
        q3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                q3ActionPerformed(evt);
            }
        });
        getContentPane().add(q3);
        q3.setBounds(630, 300, 110, 40);

        q4.setFont(new java.awt.Font("Noto Sans", 1, 14)); // NOI18N
        q4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                q4ActionPerformed(evt);
            }
        });
        getContentPane().add(q4);
        q4.setBounds(630, 350, 110, 40);

        q5.setFont(new java.awt.Font("Noto Sans", 1, 14)); // NOI18N
        q5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                q5ActionPerformed(evt);
            }
        });
        getContentPane().add(q5);
        q5.setBounds(630, 400, 110, 40);

        q6.setFont(new java.awt.Font("Noto Sans", 1, 14)); // NOI18N
        q6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                q6ActionPerformed(evt);
            }
        });
        getContentPane().add(q6);
        q6.setBounds(630, 450, 110, 40);

        jButton6.setFont(new java.awt.Font("Noto Sans", 0, 18)); // NOI18N
        jButton6.setText("Sair");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton6);
        jButton6.setBounds(840, 680, 100, 40);

        jButton7.setFont(new java.awt.Font("Noto Sans", 0, 18)); // NOI18N
        jButton7.setText("Ajuda");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton7);
        jButton7.setBounds(740, 680, 90, 40);

        jLabel13.setFont(new java.awt.Font("Century Schoolbook L", 0, 36)); // NOI18N
        jLabel13.setText("Rebaixamento Especifico");
        getContentPane().add(jLabel13);
        jLabel13.setBounds(300, 50, 661, 112);

        jButton8.setFont(new java.awt.Font("Noto Sans", 0, 18)); // NOI18N
        jButton8.setText("Voltar");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton8);
        jButton8.setBounds(620, 680, 104, 40);

        jLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGEM/newpackage/ok.png"))); // NOI18N
        getContentPane().add(jLabel8);
        jLabel8.setBounds(0, -10, 1030, 790);

        setSize(new java.awt.Dimension(1028, 772));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        MENU M = new MENU();
        this.setVisible(false);
        M.setVisible(true);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        Scanner ler = new Scanner (System.in);
        //int a, a1, a2, a3, a4, a5;
        double reba1, soma1, soma2;
        
        //System.out.println("Forca da equipe entre 1 - 100");
        //a = ler.nextInt();
        int a = Integer.parseInt(q1.getText());
        //System.out.println("Qualidade do Elenco");
        //a1 = ler.nextInt();
        int a1 = Integer.parseInt(q2.getText());
        //System.out.println("Pontos Feitos no torneio");
        //a2 = ler.nextInt();
        int a2 = Integer.parseInt(q3.getText());
        //System.out.println("Qualidade dos proximos adversarios");
        //a3 = ler.nextInt();
        int a3 = Integer.parseInt(q4.getText());
        //System.out.println("Quantidade Pontos restantes");
        //a4 = ler.nextInt();
        int a4 = Integer.parseInt(q5.getText());
        //System.out.println("Jogos Restantes");
        //a5 = ler.nextInt();
        int a5 = Integer.parseInt(q6.getText());
        
        soma1 = (a*a1*a2);
        soma2 =(a*a3*a4*a5);
        
        reba1 = soma2 / soma1;
        //System.out.println("Probabilidade de ser reibaixado é: "+ reba1 + "%");
        q7.setVisible(true);
        q7.setText(String.valueOf(reba1*100 +" %"));
        
    }//GEN-LAST:event_jButton3ActionPerformed

    private void q1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_q1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_q1ActionPerformed

    private void q2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_q2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_q2ActionPerformed

    private void q3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_q3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_q3ActionPerformed

    private void q4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_q4ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_q4ActionPerformed

    private void q5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_q5ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_q5ActionPerformed

    private void q6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_q6ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_q6ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        System.exit(0);
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        ajuda03 M = new ajuda03();
       this.setVisible(false);
       M.setVisible(true);
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        MENU M = new MENU();
       this.setVisible(false);
       M.setVisible(true);
    }//GEN-LAST:event_jButton8ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(tela4.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(tela4.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(tela4.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(tela4.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new tela4().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JTextField q1;
    private javax.swing.JTextField q2;
    private javax.swing.JTextField q3;
    private javax.swing.JTextField q4;
    private javax.swing.JTextField q5;
    private javax.swing.JTextField q6;
    private javax.swing.JTextField q7;
    // End of variables declaration//GEN-END:variables
}
