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.
Entry Filed under: Uncategorized
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to comments via RSS Feed