NJIT CS 602 - Display a Text file in an Applet

Unformatted text preview:

Steps to Display a Text file in an AppletTable of ContentsInitial ConditionsSource Code ScreenshotSource Code (Cont’d)Slide 6Creating a Jar fileCreating a Jar file (Cont’d)Slide 9Slide 10Slide 11Slide 12Jar File CreatedScreenshot of Data FileAdding a Text File to a Jar FileSlide 16Adding a Text file to a Jar fileSlide 18View of Jar file after adding the Text File – “data.txt”Creating HTML FileHTML FileUploading the files on FTP ServerScreenshot of my FTP spaceApplet on WebsiteScreenshot of Applet on WebsiteApplet on Local Computer (using Applet Viewer)Errors and solutionReferencesSteps to Display a Text file in an AppletAbhishek MehtaTable of Contents•Initial Conditions•Source code screenshots•Creating a Jar File•Adding a text file in the Jar file•Uploading the files on Ftp Server•Viewing Applet on the website•Errors and SolutionsInitial Conditions•Go to the website http://www.eclipse.org and download the latest version of eclipse.•Extract the downloaded file to a folder and then click the file named “eclipse.exe”–Create a workspace.–Workspace is the area where you create projects / packages / Interface / Class files. –A folder will be created named “Workspace” in C:\Documents and Settings\Abhishek Mehta\workspace.Source Code ScreenshotSource Code (Cont’d)Source Code (Cont’d)Creating a Jar fileCreating a Jar file (Cont’d)Creating a Jar file (Cont’d)Creating a Jar file (Cont’d)Creating a Jar file (Cont’d)Creating a Jar file (Cont’d)Jar File CreatedScreenshot of Data FileAdding a Text File to a Jar File•Jar files are same as zip files•Open .jar files with winzip or winrar•Add a text file to the archive•Save the file•Next slides will show you the screenshotsAdding a Text File to a Jar FileAdding a Text file to a Jar fileAdding a Text file to a Jar fileView of Jar file after adding the Text File – “data.txt”Creating HTML File •HTML File is required to view the applet on the website•Name the HTML file with a convenient name •Save the file, in my case it is on the Desktop•The next slide will show the contents of the HTML fileHTML FileUploading the files on FTP Server•So far we have two filesHTML File Jar File (Class file + Text File)•Upload the Files on any of the Ftp servers from afs1.njit.edu – afs30.njit.edu•The files should be placed in the “public_html” folderScreenshot of my FTP spaceApplet on Website•Type the following in the address barhttp://web.njit.edu/~UCID/filename.htmlIn my case,http://web.njit.edu/~arm36/ReadFile.htmlScreenshot of Applet on WebsiteApplet on Local Computer(using Applet Viewer)Errors and solution•One Silly mistake; Did you update the new class file•If you don’t see the applet on the websiteCheck the java file, the class should be defined public OR Check if both the .jar file and the html file are placed in the same folder ORCheck if you add the data file in the .jar fileReferences•Eclipse Tutorial•Java 2 SE


View Full Document

NJIT CS 602 - Display a Text file in an Applet

Download Display a Text file in an Applet
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Display a Text file in an Applet and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Display a Text file in an Applet 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?