import java.text.NumberFormat;
import java.util.Scanner;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
/*
 * LabExerciseThree.java
 *
 * Created on February 14, 2005, 3:41 PM
 */

/**
 *
 * @author Bill Kraynek
 */
public class LabExerciseThree {
    
    /** Creates a new instance of LabExerciseThree */
    public LabExerciseThree() {
        String out = "";
        while(true) {
            String input = JOptionPane.showInputDialog("Enter a word");
            // if the user clicks on the cancel button then null is returned so quit
            if( input == null ) break;
            if( input.equals("Texas") ) continue;
            out += input + "\n";
        }// end while
        String numberString = JOptionPane.showInputDialog("Enter a number");
        Scanner scanner = new Scanner(numberString);
        int number = scanner.nextInt();
        NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();
        out += currencyFormat.format(number);
        JTextArea outArea = new JTextArea(20,20);
        outArea.setText(out);
        JOptionPane.showMessageDialog(null,new JScrollPane(outArea));
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        new LabExerciseThree();
    }
    
}

