伊莉遊戲
When you’re finished, the dialog box should look like Figure 5. Now click Save and exit NotePad.
Compile the Souce File
From the Start menu, select the MS-DOS Prompt (Windows 95/98) or Command Prompt (Windows NT/2000) application. When the application launches, it should look like Figure 6.
The prompt shows your current directory. When you bring up the prompt for Windows 95/98, your current directory is usually WINDOWS on your C drive (as shown in Figure 6) or WINNT for Windows NT. To compile your source code file, changes your current directory to the one in which your file is located. For example, if your source directory is java on the C drive, you would type the following command at the prompt and press Enter:
cd c:\java
Now the prompt should change to C;\java. To change to a directory on a different drive, you must type an extra command. As shown in Figure 7, to change to the java directory on the D drive, you must reenter the drive, d:.
In our example, the java directory is on the C drive. The dir command lists the files in your current directory. If your current directory is C:\java and your enter dir at the prompt, you should see your file (Figure 8).
Now You can compile. At the prompt, type the following command and press Enter:
Javac HelloWorldApp.java
If your prompt reappears without error messages, congratulations. You have successfully compiles your program. If you encounter errors, see Error Explanation (Win32) to help you fix the problems.
The compiler has generated a Java bytecode file, HelloWorldApp.class. At the prompt, type dir to see the new file that was generated (Figure 9). Now that you have a .class file, you can run your program.
Run the program
In the same directory, enter the following command at prompt:
Java HelloWorldApp
Figure 10 shows what you should see.
Creating Your First Applet
HelloWorldApp is an example of an application, a standalone program. Now you will create an applet called HelloWorld, [color=blue][size=2][ [u]瀏覽完整內容請先註冊或登入會員[/u]。][/size][/color]
|

能在車站遇到你, 是一種綠份, 我會好好珍惜的!!
天晴係生命上的失敗者, 正在努力改變命運中
唔希望你地跟我一樣, 所以要加油努力呀!
|