/* COSC 304 section 2 LUKE BURGESS luke_burgess@hotmail.com @00205854 Sept 17 2000 */ // Project 2: Exercise 3.21, page 111 from "Java How To Program", Deitel & Deitel // Applet that reads a first and last name from the user as two separate // inputs, joins them together separated by a space and prints the result import javax.swing.JOptionPane; import javax.swing.JApplet; import java.awt.Graphics; public class Exercise21p111 extends JApplet { String fullName, // result. firstName, lastName; // strings to join. // Display results public void paint (Graphics g) { // read first and last name from user as Strings firstName = JOptionPane.showInputDialog ("Enter first name:"); lastName = JOptionPane.showInputDialog ("Enter last name:"); // join first and last name separated by a space fullName = firstName + " " + lastName; g.drawString (fullName, 25, 25); } // paint () } // class Exercise21p111