Sei sulla pagina 1di 5

package MundialBrasil; import java.awt.FlowLayout; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ImageIcon; import javax.swing.

JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; public class MundialBrasil { public static void main(String[] args) { // TODO code application logic here JLabel imagenb = new JLabel(); imagenb.setIcon(new ImageIcon("C:/Users/lab.informatica12/Pictures/2014.jpg")); JOptionPane.showMessageDialog(null,(imagenb)); JFrame frame = new JFrame ("Bienvenido: opciones de consulta"); frame.setSize(170, 400); frame.setLocationRelativeTo(frame); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); JLabel label = new JLabel ("Que desea consultar?"); label.setFont(new Font ("Serif", Font.ITALIC,14)); final JCheckBox checka = new JCheckBox("Integrantes por grupo"); final JCheckBox checkb = new JCheckBox("Enfrentamientos"); final JCheckBox checkc = new JCheckBox("Resultados"); final JCheckBox checkd = new JCheckBox("LLaves octavos"); final JCheckBox checke = new JCheckBox("Llaves cuartos"); final JCheckBox checkf = new JCheckBox("Llaves Semifinal"); final JCheckBox checkg = new JCheckBox("Tercer y cuarto puesto");

final JCheckBox checkh = new JCheckBox("Final"); JButton boton1 = new JButton(" Consultar "); frame.setLayout(new FlowLayout()); frame.add(label); frame.add(checka); frame.add(checkb); frame.add(checkc); frame.add(checkd); frame.add(checke); frame.add(checkf); frame.add(checkg); f rame.add(checkh); frame.add(boton1); boton1.addActionListener(new ActionListener() { @SuppressWarnings("empty-statement") public void actionPerformed(ActionEvent e) { if(checka.isSelected()) { JFrame frame = new JFrame ("Grupo Selecciones"); frame.setSize(200, 200); frame.setLocationRelativeTo(frame); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); JLabel label = new JLabel ("Que grupo desea Consultar?"); label.setFont(new Font ("Serif", Font.ITALIC,14)); final JCheckBox check1 = new JCheckBox("A"); final JCheckBox check2 = new JCheckBox("B"); final JCheckBox check3 = new JCheckBox("C"); final JCheckBox check4 = new JCheckBox("D"); final JCheckBox check5 = new JCheckBox("E"); final JCheckBox check6 = new JCheckBox("F");

final JCheckBox check7 = new JCheckBox("G"); final JCheckBox check8 = new JCheckBox("H"); JButton boton = new JButton(" Enviar "); frame.setLayout(new FlowLayout()); frame.add(label); frame.add(check1); frame.add(check2); frame.add(check3); frame.add(check4); frame.add(check5); frame.add(check6); frame.add(check7); frame.add(check8); frame.add(boton); boton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String cadena1=""; if(check1.isSelected()) { cadena1 = "Brasil\nCroacia\nMexico\nCamerun"; } if(check2.isSelected()) { cadena1 = "Espaa\nHolanda\nChile\nAustralia"; } if(check3.isSelected()) { cadena1 = "Colombia\nGrecia\nCosta De Marfil\nJapon"; } if(check4.isSelected()) { cadena1 = "uruguay\nCosta Rica\nInglaterra\nItalia"; } if(check5.isSelected()) { cadena1 = "Suiza\nEcuador\nFrancia\nHonduras"; } if(check6.isSelected()) { cadena1 = "Argentina\nBosnia\nIran\nNigeria"; } if(check7.isSelected()) { cadena1 = "Alemania\nPortugal\nGhana\nEE.UU"; }

if(check8.isSelected()) { cadena1 = "Belgica\nArgelia\nRusia\nCorea Del Sur"; } JOptionPane.showMessageDialog(null, cadena1 ); if(checkb.isSelected()) { JFrame frame = new JFrame ("Primera fecha"); frame.setSize(200, 200); frame.setLocationRelativeTo(frame); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); JLabel label = new JLabel ("Que grupo desea Consultar?"); label.setFont(new Font ("Serif", Font.ITALIC,14)); final JCheckBox check1 = new JCheckBox("A"); final JCheckBox check2 = new JCheckBox("B"); final JCheckBox check3 = new JCheckBox("C"); final JCheckBox check4 = new JCheckBox("D"); final JCheckBox check5 = new JCheckBox("E"); final JCheckBox check6 = new JCheckBox("F"); final JCheckBox check7 = new JCheckBox("G"); final JCheckBox check8 = new JCheckBox("H"); JButton boton = new JButton(" Consultar "); frame.setLayout(new FlowLayout()); frame.add(label); frame.add(check1); frame.add(check2); frame.add(check3); frame.add(check4); frame.add(check5); frame.add(check6); frame.add(check7); frame.add(check8); frame.add(boton);

boton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String cadena1=""; if(check1.isSelected()) { cadena1 = "Brasil vs Croacia\nMexico vs Camerun"; } if(check2.isSelected()) { cadena1 = "Espaa vs Holanda\nChile vs Australia"; } if(check3.isSelected()) { cadena1 = "Colombia vs Grecia\nCosta De Marfil vs Japon"; } if(check4.isSelected()) { cadena1 = "uruguay vs Costa Rica\nInglaterra vs Italia"; } if(check5.isSelected()) { cadena1 = "Suiza vs Ecuador\nFrancia vs Honduras"; } if(check6.isSelected()) { cadena1 = "Argentina vs Bosnia\nIran vs Nigeria"; } if(check7.isSelected()) { cadena1 = "Alemania vs Portugal\nGhana vs EE.UU"; } if(check8.isSelected()) { cadena1 = "Belgica vs Argelia\nRusia vs Corea Del Sur"; } }}} JOptionPane.showMessageDialog(null, cadena1 ); }}

Potrebbero piacerti anche