Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.LinkedList;
- import javax.swing.JOptionPane;
- public class Principal {
- public static void main(String[] args) {
- LinkedList<Lista> lista = new LinkedList<>();
- Lista aux = new Lista();
- int opcion = 0;
- while(opcion != 3){
- opcion = aux.Menu();
- switch(opcion){
- case 1:
- Lista equipo = new Lista();
- equipo = equipo.AgregarEquipo(equipo);
- if(equipo != null){
- lista.add(equipo);
- }else{
- JOptionPane.showMessageDialog(null, "Este equipo no fue agregado");
- }
- break;
- case 2:
- if(!lista.isEmpty()){
- aux.MostrarResultados(lista);
- }else{
- JOptionPane.showMessageDialog(null, "La lista esta vacia");
- }
- break;
- case 3:
- JOptionPane.showMessageDialog(null, "¡¡¡FIN DEL PROGRAMA!!!");
- break;
- default:JOptionPane.showMessageDialog(null, "La opcion ingresada es incorrecta");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement