public class Agenda{ public static int entrada; public static void main( String args[] ){ String agenda[][]; agenda=new String [20] [3]; int x; int y=0; int cont=0; listaOpcao(); while( entrada != 4 ){ if( entrada == 1 ) preencheAgenda(); else if( entrada == 2 ) listaAgenda(); else if( entrada == 3) editarAgenda(); else JOptionPane.showMessageDialog( null, "Opcao Incorreta!" ); listaOpcao(); } } public static void preencheAgenda(){ for (x=0;x<20;x++){ cont=(cont+1); if (y!=-1){ agenda[x][0]=JOptionPane.showInputDialog("Digite o nome:"); agenda[x][1]=JOptionPane.showInputDialog("Digite o Endereco:"); agenda[x][2]=JOptionPane.showInputDialog("Digite o número:"); y=Integer.parseInt(JOptionPane.showInputDialog("Quer adicionar outro nome? 0=sim, -1=não")); } else{ x=20; } } } public static void listaAgenda(){ y=0; if (cont>1){ for (x=0;x