/* Show Address Box Version 1
 * Author: Robert Laurie
 * Date: 15 February 2006
 * ------------------------------------
 * Description: p40 #3
 */
import javax.swing.*;
public class ShowAddressBox1
{
  public static void main(String[] args)
  {
    JOptionPane.showMessageDialog(null,"Robert Laurie"
       +"\n141 Main Street\nSaipan, MP  96950");
    System.exit(0);
  }
}

/* Show Address Box Version 2
 * Author: Robert Laurie
 * Date: 15 February 2006
 * ------------------------------------
 * Description: p40 #3
 */
import javax.swing.*;
public class ShowAddressBox2
{
 // Class data declaration section
  private String sMessage;
  private String sTitle;

  //Class method definition section
  ShowAddressBox2() // Constructor Method
  {
    sMessage = "Robert Laurie\n141 Main Street\nSaipan, MP  96950";
    sTitle = "Address Information";
  }

  public void displayDialogBox()
  {
    JOptionPane.showMessageDialog(null,sMessage, sTitle, JOptionPane.INFORMATION_MESSAGE);
  }

  public static void main(String[] args)
  {
      ShowAddressBox2 oAddressMe;
      oAddressMe = new ShowAddressBox2();
      oAddressMe.displayDialogBox();
      System.exit(0);
  }
}

/* Show Parts Box Version 1
 * Author: Robert Laurie
 * Date: 15 February 2006
 * ------------------------------------
 * Description: p40 #5
 */
import javax.swing.*;
public class ShowPartsBox1
{
  public static void main(String[] args)
  {
    JOptionPane.showMessageDialog(null,
      "PART NO.   PRICE\n"
      + "T1267      $6.34\n"
      + "T1300      $8.92", "Prices",
      JOptionPane.PLAIN_MESSAGE);
    System.exit(0);
  }
}

/* Show Parts Box Version 2
 * Author: Robert Laurie
 * Date: 15 February 2006
 * ------------------------------------
 * Description: p40 #5
 */
import javax.swing.*;
public class ShowPartsBox2
{
 // Class data declaration section
  private String sMessage;
  private String sTitle;

  //Class method definition section
  ShowPartsBox2() // Constructor Method
  {
    sMessage = "Part No.    Price\n"
             + "T1267       $6.34\n"
             + "T1300       $8.92";
    sTitle = "Parts Price";
  }

  public void displayDialogBox()
  {
    JOptionPane.showMessageDialog(null,sMessage, sTitle, JOptionPane.PLAIN_MESSAGE);
  }

  public static void main(String[] args)
  {
      ShowPartsBox2 oParts;
      oParts = new ShowPartsBox2();
      oParts.displayDialogBox();
      System.exit(0);
  }
}

/* Code Rewrite for TestIt
 * Author: Robert Laurie
 * Date: 15 February 2006
 * ------------------------------------
 * Description: p43 #2c
 */
public class TestIt2c
{
  public static void main(String[] args)
  {
    System.out.print("Reading a program");
    System.out.println(" is much easier");
    System.out.println("if a standard form for main is used");
    System.out.print("and each statement is written");
    System.out.println(" on a line by itself.");
  }
}