Display information in Java GUI
<p>The code below is my attempt at creating a simple GUI to ask a user to input information relating to a book and display it.  the problem is i'd like to display the questions i.e. enter title, enter author etc.  in one go rather than each one displaying one at a time as in the code i've written so far, also i want to display the cost as Double but not sure how to go about it.  any pointers please?  i'd like to do it without completely changing the code i've written below as i'm a beginner and want to see how to build on what i've done so far.  thanks, Simon</p>

<pre><code>import javax.swing.JOptionPane;

public class GUI 

{

    public static void main (String args[])

    {
        String title  = "";
        String author = "";
        String year = "";
        String publisher = "";
        String cost = "";

        title = JOptionPane.showInputDialog("Enter Title");
        author = JOptionPane.showInputDialog("Enter Author");
        year = JOptionPane.showInputDialog("Enter Year");
        publisher = JOptionPane.showInputDialog("Enter Publisher");     
        cost = JOptionPane.showInputDialog("Enter Cost");

        String message =  "The title of the book is :" + title +", " +
                "and the Author of the Book is :" + author +". It was published in" + year + "by " + publisher +
                "and retails at" + cost;

        ;

        JOptionPane.showMessageDialog(null, message, "Book Details", JOptionPane.PLAIN_MESSAGE); 

                System.exit(0);
    }


}
</code></pre>
