Java applets Dr Jim Briggs WEBP Applets 1
Java applets Dr Jim Briggs WEBP Applets 1
What is an applet? • Runs on the client • Needs browser… – with JVM embedded (old style) – that uses Java plug-in (new style) • More sophisticated user interface than is possible with HTML (even with Java. Script and CSS) • Full-power GUI • Applet launched from within an HTML page • Severe restrictions on what it can do that may impact on the client machine WEBP Applets 2
Under the hood • Applets can be tested using the Applet. Viewer tool (part of the SDK) • However, note that this does not implement the same security model as applies when an applet is run in a browser WEBP Applets 3
What can an applet do? • Be notified by the browser of milestones (init, start, etc. ). • Load data files specified relative to the URL of the applet or the page in which it is running. • Display short status strings. • Make the browser display a document. • Find other applets running in the same page. • Play sounds. • Get parameters specified by the user in the <APPLET> tag. WEBP Applets 4
What can't an applet do? • Applets downloaded over the net cannot: – load libraries or define native methods – ordinarily read or write files on the host that is executing it – make network connections except to the host that it came from – start any program on the host that is executing it – read certain system properties (ones that refer to user details) WEBP Applets 5
Java GUIs • Abstract Window Toolkit (AWT) – components, containers – visual controls (buttons, menus, scrollbars, …) – layout managers • Swing – wide variety of lightweight controls – based on top of AWT WEBP Applets 6
- Slides: 6