java - How do I append data all into one dialog box? -


i have problem address book program. view entries address book, displayed in different dialog boxes. first entry displayed in first dialog box , if click "ok" next entry shown in dialog box. want entries shown in 1 dialog box.

here's getter method:

public string getinfo(){         string info = "name\taddress\tphone no.\te-mail add\n" +                 name +"\t " + add +"\t "+ phoneno +"\t "+ email +"\n";         return info;     } 

here's how display information:

public void viewall() {         (int = 0; < counter; i++) {             joptionpane.showmessagedialog(null, new jtextarea(entry[i].getinfo()));         }     } 

hope can me... in advance :)

in order view entries inside 1 dialog box, can try creating string add entries. see code below:

 public string getinfo() {    string content = "\t" + name + "\t"+ address + "\t\t" + telno + "\t" + email;    return content; }   public class addressbook  public void viewallentry() {         string addtext = "no\tname\taddress\t\ttel.no\temail\t\n"; /<------here         (int = 0; <  addressbookentrycounter; i++) {             addtext = addtext+(i+1)+ entry[i].getinfo()+ "\n";     /<------here         }         joptionpane.showmessagedialog(null, new jtextarea(addtext));     }  } 

you try ninesided's solution


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -