星期二, 3月 13, 2007

Lab: Window input dialog

Use the following command to generate a window input dialog

String myString=JOptionPane.showInputDialog("Enter a number: ");

use the following command to convert a string to a number

int myNumber = Integer.parseInt(myString);

and finally use the following command to print the input number to the console

System.out.println("The number is "+ myNumber);

Don't forget the following import command

import javax.swing.JOptionPane;

so that Java can recognize JOptionPane library.

35 則留言:

匿名 提到...

應數碩二9461006陳志威

Jim 提到...

9427217林明駿

蔡胖 提到...

電子三以9326202蔡勝勛

Unknown 提到...

電子三丙 蕭宇宏

匿名 提到...

電子二甲 9426116 藍宇霆

匿名 提到...

電子二丙 9426318 徐玉娟

匿名 提到...

電子二乙 李昱昇 9426260

匿名 提到...

9426127 電子二甲 呂明君

MR.超 提到...

電子三丙9326358溫建宇

匿名 提到...

9226330 電子四丙 張展魁

匿名 提到...

電子二甲 9426102 許志瑋

匿名 提到...

9426126電子二甲 葉昱慶

匿名 提到...

電子二丙 徐衍翰 9426304

匿名 提到...

電子二甲9426161 邱霆宇

wendell 提到...

電子三乙9326245馬瑱賢

匿名 提到...

9426258電子二乙 李彥勳

小向 提到...

9426134電子二甲向芝儀

s9226148 提到...

電子四甲9226148張競升

匿名 提到...

電子二甲9426131彭依萍

匿名 提到...

電子四乙9126240蔡明翰

匿名 提到...

電子四丙黎玉全

匿名 提到...

電子三丙9326305張嘉軒

匿名 提到...

9326157 張格榮 電子三甲

匿名 提到...
作者已經移除這則留言。
匿名 提到...
作者已經移除這則留言。
匿名 提到...
作者已經移除這則留言。
匿名 提到...
作者已經移除這則留言。
電子四丙9126338何俊學 提到...

電子四炳9126338何俊學

匿名 提到...

9426232電子二乙鄧名鈞

匿名 提到...

電子四丙黎玉全

匿名 提到...

9326143 電子三甲 薛子源

貓老爺 提到...

電子三乙 9326265 梁躍叡

匿名 提到...

電子三甲9326152蕭名宏

電子四甲 9326161 陳健勳 提到...

9326161 電子三甲 陳健勳 http://st912458.blogspot.com/

匿名 提到...

lzam 電子四丙9226332陳鴻政