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);
}
}
import javax.swing.*;
public class ShowAddressBox2
{
private String sMessage;
private String sTitle;
ShowAddressBox2()
{
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);
}
}
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);
}
}
import javax.swing.*;
public class ShowPartsBox2
{
private String sMessage;
private String sTitle;
ShowPartsBox2()
{
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);
}
}
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.");
}
}