Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. este es el metodo de accion del panel de destino
  2.  
  3.  
  4.  
  5.  
  6.  
  7. public void actionPerformed( ActionEvent e )
  8. { String d=e.getActionCommand();
  9. try{
  10. if(d.equals(AGREGAR_1)){
  11. pais=JOptionPane.showInputDialog(this, "Pais");
  12. if (pais!=null){
  13. ciudad=JOptionPane.showInputDialog(this, "Ciudad");
  14. if(ciudad!=null){
  15. crucero.agregarDestino(ciudad, pais);
  16. crucero.darDestinoActual();
  17. }
  18. }
  19. }else if(d.equals(SIGUIENTE)){
  20. crucero.darSiguienteDestino();
  21. }else if(d.equals(ANTERIOR)){
  22. crucero.darAnteriorDestino();
  23. }else if(d.equals(ELIMINAR)){
  24. crucero.eliminarDestinoActual();
  25. JOptionPane.showMessageDialog(this, "se elimino correctamente el destino: "+crucero.darDestinoActual().darCiudad()+"-"+ crucero.darDestinoActual().darCiudad(), "Eliminacion destino", JOptionPane.INFORMATION_MESSAGE);
  26. }else if(d.equals(BUSCAR_1)){
  27. pais=JOptionPane.showInputDialog(this, "Pais");
  28. if (pais!=null){
  29. ciudad=JOptionPane.showInputDialog(this, "Ciudad");
  30. if(ciudad!=null){
  31. crucero.buscarDestino(ciudad, pais);
  32. }
  33. }
  34.  
  35. }
  36. }catch(Exception a){
  37. JOptionPane.showMessageDialog(this, a.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement