Showing your applet on a webpage 1 11/22/2013 Steps Find the - - PDF document

showing your applet
SMART_READER_LITE
LIVE PREVIEW

Showing your applet on a webpage 1 11/22/2013 Steps Find the - - PDF document

11/22/2013 CSCI-1101B Lab Java Topics Applet on webpage Interface GUI Mohammad T . Irfan 11/22/13 Showing your applet on a webpage 1 11/22/2013 Steps Find the build folder inside your project folder You will see An html


slide-1
SLIDE 1

11/22/2013 1

CSCI-1101B Lab Java Topics

Applet on webpage Interface GUI Mohammad T . Irfan 11/22/13

Showing your applet

  • n a webpage
slide-2
SLIDE 2

11/22/2013 2

Steps

 Find the build folder inside your project

folder

 You will see

 An html file  A folder named classes

 Copy objectdraw.jar file into the classes

folder

 Edit the html:

 <APPLET codebase="classes"

code="roachmasterv5/RoachMasterV5.class" archive="objectdraw.jar" width=800 height=600></APPLET>

My html file

slide-3
SLIDE 3

11/22/2013 3

After opening it in web browser

Running your application without Netbeans

slide-4
SLIDE 4

11/22/2013 4

Steps

 LinkedList project example

 In Nebeans, go to Run menu and click “clean and

build”

 This creates a dist folder inside your project folder  You will see a .jar file there, which is executable

 My file name: LinkedList.jar

 Execute the .jar file from terminal

 Go to the right directory using cd  Command: java –jar LinkedList.jar

 You have to use the your .jar file name

Interface

Chapter 10 Java Textbook (on Blackboard)

slide-5
SLIDE 5

11/22/2013 5

Interface

 Specifies the skeleton of a class

 defines the method headers of public methods  No variables  No constructor methods – no object of interface

 To create an object

 Need to write a class that implements the

interface

 Implement each method of the interface  May have additional methods

LinkedListInterface

slide-6
SLIDE 6

11/22/2013 6

LinkedList class LinkedList class

 Many other additional methods not present

in the interface...

slide-7
SLIDE 7

11/22/2013 7

Graphical User Interfaces (GUI)

Chapter 11 Java Textbook (on Blackboard)

Java Swing

 GUI

 Buttons, text fields, text areas, labels, radio

buttons, check boxes, etc.  All can be done using Netbean’s visual design

interface

 Create a project (omit main file)

 Try to add a new java file the usual way, but from

New, select Other instead of Java class

 Select Swing GUI Form on the left  On the right, select JFrame Form

 Follow the demo

slide-8
SLIDE 8

11/22/2013 8

In-class exercise

 Add two numbers

 https://netbeans.org/kb/docs/java/gui-

functionality.html