1 / 13

Introduction

Introduction. History of Java Applets. Problems with applets The Future. History of Java. Understanding applets can only be done with some background. James Gosling (Green Project) C++ Based. Embedded Systems --- born out of frustration. Java and the Internet.

bonita
Download Presentation

Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction • History of Java • Applets. • Problems with applets • The Future.

  2. History of Java • Understanding applets can only be done with some background. • James Gosling (Green Project) • C++ Based. • Embedded Systems --- born out of frustration.

  3. Java and the Internet • Right time, right place. • Mosaic – the first browser to conceive of the idea to use Java within it. • HotJava – intended for cable T.V. lead the way to the development of the applet.

  4. Applets • Embeddable applications • Intended to be run inside other programs --- web browsers. • Why bother? • Extensibility of HTML. • Markup languages limited in functionality • GUI extensions – cross-platform in this instance.

  5. Applets (2) • How do they work? • Differently from Java! • No psvm() • Java VM essential (has issues though). • The life-cycle: • init() ---> [ start() <---> start() ] [<-- R] --> destroy() • (R): repeated whenever page left, re-entered.

  6. Applets (3) • Example: • <html> • <head><title>Wow. My First Applet</title></head> • <body> • <applet code=”mfa.class” width=500 height=100></applet> • [.....] • </body> • </html>

  7. Applets (4) • Example (Java): • import java.applet.*; • import java.awt.*; • public class AV extends Applet { • int count = 0; • Color spect[] = new Color[3]; • public void init() • { • spect[0] = Color.red; • spect[1] = Color.green; • spect[2] = Color.blue; • } • public void start() • { • count++; • } • public void paint(Graphics g) • { • g.setColor(spect[count%3]); // Change colour. • g.drawString("Applet DEMO: "+count,10,20); • } • }

  8. Applets (4) • Output:

  9. Applets: Problems • This is Java – of course there are problems. • JVM – costly on the client. • Different web browsers, different ideas • Netscape versus Internet Exploder – remember that? • Proprietry DOMs – how do you know which is which, and should it be down to the Java Applet to know? • Security – overloading, browser-crashes, etc.

  10. Applets: Problems (2) • Oversight – does the richness Applets provide necessitate their use? • JVM compatability issues: Flash all the way... • (I hope not – that sucks as much as Java does) • JVM startup times are huge – and for what? • Applets tend to be abused by site developers to provide flashy animations that is unwelcome sometimes.

  11. Applets: API • Yes, that's right – there's an interface to Applets. • There wasn't much of one to begin with. • There is now though – and in its current state allows for extendability in the same way one would use a normal Java Application.

  12. The Future • Applets never really caught on. • But that's OK. Really... • AJAX (Asynchronous JavaScript And XML). • Remove the presentation and the content. • Shift the processing to the sever, rather than the client (hence asynchronous). • RoR – Ruby on Rails – an extensible framework written in Ruby. Beats the pants off Java, anyday.

  13. References http://java.sun.com http://c2.com/cgi/wiki http://www.bookrags.com/sciences/computerscience/java-applets-csci-04.html http://www.rubyonrails.org Books: “Big Java”, Horstmann, J. 2000

More Related