PaneTest - System.out.println"You typed""...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// File: // Course: CSC 211 // Author: Amber Settle // Purpose: Demonstrate the use of JOptionPane for input and output / import javax.swing.JOptionPane; i public class PaneTest { public static void main(String[] args) { // Create a JOptionPane to get an input String, // and store the input String in the object s / String inputStr = JOptionPane.showInputDialog ("Enter a string: "); ( // Echo the input String to the screen /
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: System.out.println("You typed \"" + inputStr + "\""); S // Also echo the input String to a second JOptionPane / JOptionPane.showMessageDialog(null, "You typed \"" + inputStr + "\""); J // If we type in a number, can we manipulate it like a number? // In other words, what happens if we try to do the following? // System.out.println(inputStr * 2); / // Explicitly end the application System.exit(0); } }...
View Full Document

This note was uploaded on 03/05/2011 for the course CSCI 384 taught by Professor Drchan during the Spring '11 term at CA Health Sciences.

Ask a homework question - tutors are online