DOC PREVIEW
NJIT CS 602 - Lecture Notes

This preview shows page 1-2-3-4-5-32-33-34-35-65-66-67-68-69 out of 69 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 69 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

NetBeans IDE 5.0 Tutorial for AppletsDeployment OptionsContents of this presentationSetting Up Java Applets on AFS ManuallyAFS and Java AppletsSlide 6Running Java Applets on AFSLog on to AFSLog on AFSChange DirectorySlide 11Compile Java fileRun the Java AppletNetBeans Essentials for Java AppletsCreate/ Import CodeCreate a new projectName the new projectCreate a new applet fileCompile an appletCompiling MessageRun the Java appletApplet ViewerWeb ApplicationsDeploying JAR files on AFSWeb ApplicationSlide 26Slide 27Deploying Web ApplicationsSuccessNetBeans IDE 5.0 Applet Deployment on AFSTutorial OutlineCreating the Java project from scratch or from existing sourcesSlide 33Slide 34Creating the applet source fileSample source code: ReadFile AppletSlide 37Slide 38Slide 39Slide 40Build and run applet source fileSlide 42Slide 43Debug the applet source file by modifying its parametersSlide 45Create the applet-embedded Web ApplicationSlide 47Slide 48Add the applet JAR file to the web projectSlide 50Slide 51Create and run the JSP file or HTML fileSlide 53OutputDeploy the NetBeans Java Project on AFSCreate the links to Java projects on AFSTransfer Java project and files to AFS ClientsTransfer file to AFS ClientsSlide 59Trouble Shooting SectionFrequently Asked QuestionsFAQSlide 63Slide 64ReferenceSlide 66Slide 67Slide 68Slide 69NetBeans IDE 5.0Tutorial for AppletsFang ChuKamolbhan OlapiriyakulDeployment Options•There are at least three ways to put a NetBeans created applet on the NJIT AFS system.•The first method is to create and test source code in NetBeans, but then transfer it to AFS, compile it there, and set it up manually.•The second method is to create a JAR file in NetBeans, copy it to AFS, and configure it there with Netbeans.•The third method is to package a stand-alone JAR package in NetBeans and deploy it to AFS.Contents of this presentation•The detailed presentation, with code, uses the third option and is discussed last.•The other two options are described briefly, along with explanatory material on Applets, AFS, and NetBeans, as an introduction to the final topic.Setting Up Java Applets on AFSManuallyFang ChuAFS and Java Applets•To create a homepage on AFS for Java Class, see the instructions athttp://web.njit.edu •Your web pages will have an address like thishttp://web.njit.edu/~gblank•Use FTP software or AFS Clients to upload your web pages to your directoryhttp://csd.njit.edu/softwarehttp://www.coreftp.com/download.htmlAFS and Java Applets•To run a Java applet on the web, you embed code similar to the following in an HTML file and then upload the file as a webpage.•Applet Container Code Sample:<applet code=“ReadFile.class” width=300 height=350></applet>Running Java Applets on AFS•Log on to AFS (afs1-afs32)•Change to your java file directory•Compile the java file •Make sure that java file, java class file, text file and html applet container are in the same directory•Link to the html applet container online to enable the java appletLog on to AFS Click on “Start” at bottom rightClick on “Run”next to bottomLog on AFSType in UCID andPass wordChange DirectoryCurrent DirectoryChange DirectoryChange directory to the folder containing “ReadFile.java”Using command“cd”Compile Java file Compile java fileUsing command“javac”No warning error info“ReadFile” generated!Run the Java AppletNetBeans Essentialsfor Java Applets•Create or import Java applet codes.•Debug, compile and run codes.•Embed codes into web applications.Create/ Import Code Step1.Create a new project or open an existing project Step 2. Create a new java applet or open an existing file.Create a new projectSelect General>>Application>>Next>>…Name the new projectAfter naming the project and selecting its directoryClick on “finish”Create a new applet fileRight-click on Source-package or new project name>>Right-click on “new”>>Left-click on “Applet”; also name the package where the applet file and text file are saved.Compile an appletRight-click on the applet file and thenleft-click on“compile”to compile the java appletCompiling MessageNo Error,Can be built and executedRun the Java applet•Include data.txt file in the same folder with java code.•“Build the project” by right-clicking on the project name node and then left-clicking it. •“Run the file”, similar to “compile”.•If applet program is correct, text will be displayed in the applet viewer. Otherwise, it may deliver a message in the bottom without initializing the applet.Applet ViewerAfter the project is built and executed, the text will be shown in the applet viewer.Web Applications•Create a web project–Choose File>New Project. Under Categories, select “Web”; under project, select “Web Application”; “next”–Under Project Name, type in a given name and then redirect the directory to the right folder; “finish”.Deploying JAR files on AFSFang ChuWeb Application•When you want to include an applet JAR file in a web project, you can do so by adding the NetBeans IDE 5.x Java project that contains the JAR file, or by adding the JAR file itself. •Note: if you adding the Java project to web project, you enable the IDE to build the applet whenever you build the web application. Therefore, when you modify the applet, the IDE builds a new version of the applet whenever the web project is built. On the other hand, if the applet JAR file is not in a NetBeans IDE 5.0 Java project, the applet source file is not rebuilt when you build the web project.Web ApplicationsStep1: In the Projects window, right-click the project node and select Properties from the contextual menu. If the applet JAR file is in a NetBeans IDE 5.x Java project, click Packaging, and then click Add Project. Browse to and select the folder that contains the NetBeans IDE 5.x Java project. Note that NetBeans IDE 5.x projects are marked by the NetBeans IDE project icon. If the applet JAR file is not in a NetBeans IDE 5.x project, click Packaging, and then click Add JAR/Folder. Browse to and select the folder that contains the JAR file.Web Applications•To embed the applet in an HTML file, right-click the project node, and choose New > File/Folder from the contextual menu. Under Categories, select Web. Under File Types, select HTML. Click Next. Give your HTML file a name and click Finish. •Embed the following tags anywhere between the file’s <body></body>tags. <applet


View Full Document

NJIT CS 602 - Lecture Notes

Download Lecture Notes
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 Lecture Notes 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 Lecture Notes 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?