Advertisement
Montoya-Romina-Anahi

TP4_Punto7_Principal

Jun 19th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. import java.util.LinkedList;
  2. import javax.swing.JOptionPane;
  3.  
  4.  
  5. public class Principal {
  6. public static void main(String[] args) {
  7.  
  8. LinkedList<Lista> lista = new LinkedList<>();
  9. Lista aux = new Lista();
  10.  
  11. int opcion = 0;
  12.  
  13. while(opcion != 3){
  14. opcion = aux.Menu();
  15. switch(opcion){
  16. case 1:
  17. Lista equipo = new Lista();
  18. equipo = equipo.AgregarEquipo(equipo);
  19. if(equipo != null){
  20. lista.add(equipo);
  21. }else{
  22. JOptionPane.showMessageDialog(null, "Este equipo no fue agregado");
  23. }
  24. break;
  25. case 2:
  26. if(!lista.isEmpty()){
  27. aux.MostrarResultados(lista);
  28. }else{
  29. JOptionPane.showMessageDialog(null, "La lista esta vacia");
  30. }
  31. break;
  32. case 3:
  33. JOptionPane.showMessageDialog(null, "¡¡¡FIN DEL PROGRAMA!!!");
  34. break;
  35. default:JOptionPane.showMessageDialog(null, "La opcion ingresada es incorrecta");
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement