Need help with output
im trying to get the list of books on one dialog box. but all it shows is the message and no book title.
Im trying to get the user to choose a book from the list. by entering 1-4.
but so far what i really need first is how to get the titles all in one box
[
if (quantity > 0){
JOptionPane.showInputDialog(null,"Choose a book to purchase or 4 to quit");
for (int i = 0; i < quantity; i++)
JOptionPane.showInputDialog(null,"\"" + volumes[i].title);
}
}
}
/code]
Heres the rest of the code
[code]
import javax.swing.JOptionPane;
import java.util.*;
class Book
{
public String title;
}
//DONT FORGET TO WRITE COMMENTS!!!!!!!!!!!!!!!
publicclass delete
{
publicstaticvoid main (String [] args)
{
Book[] volumes;
charanswer;
intquantity = 0,
limit = 0;
int option;
limit = Integer.parseInt(JOptionPane.showInputDialog(null,"How many titles in the store? (Must be no more than 20) "));//prompts the user for book titles
volumes =new Book[limit];
while (quantity < limit){
volumes[quantity] =new Book();
volumes[quantity].title = JOptionPane.showInputDialog(null,"\nEnter book " + (quantity+1) +"'s title : ");
quantity++;
}
if (quantity > 0){
JOptionPane.showInputDialog(null,"Choose a book to purchase or 4 to quit");
for (int i = 0; i < quantity; i++)
JOptionPane.showInputDialog(null,"\"" + volumes[i].title);
}
}
}

