4.10

April 23, 2008 rita1012

1.import javax.swing .JOptionPane;

public class Name 

public static void main (String[ ] args){

    string inputStr = JOptionPane.ShowInputDialog (“Enter your name, ” ” ” )

if (inputStr == null)

 return;

2.

 

3.If the expected input is a number, one other thing must be done before it can be processed. The dialog box returns a string of digits, which must be converted to an int or a double. THe methods Integer.parseInt(aString) and Double.parseDouble (a String) accomplish this for intergers and floating number points.

 

 

4.This alternative is useful when we want the size of each panel to be exactly the size we want.

 

 

 

 

 

Advertisement

Entry Filed under: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to comments via RSS Feed

Pages

Categories

Calendar

April 2008
M T W T F S S
« Feb   May »
 123456
78910111213
14151617181920
21222324252627
282930  

Most Recent Posts

 
Follow

Get every new post delivered to your Inbox.