Self-service deployment is a viable option for simple applications. Almost everyone (the key phrase being "almost everyone" -- remember the target audience) knows how to install an application on his or her machine, right? Unfortunately, as the complexity of the installation and configuration process increases, so does the support time, and this alternative begins to resemble the foot-and-hand installation. |
As lead architect of the next-generation Java Plug-in, Ken Russell is passionate and convincing on the topic of client-side Java development and the return of the applet. In this interview with Andrew Glover, Ken offers an engineer's perspective on the historic problems of applets. He then explains how the new Java Plug-in has been re-written to run on a separate process from the Web browser, enabling applets to start fast, consume the memory they need, and run without stopping or freezing the browser. |
The historic problems of applets have been well-documented and we've looked in-depth at some of the efforts currently underway to revitalize them for a new generation of Java Web developers (see this article's companion "Are applets making a comeback?"). Still, it remains to be seen if the new technologies clustering under the umbrella of Java SE 6 update 10 beta (Java SE 6u10) are enough to improve applet performance and create a Java browser and desktop experience capable of competing with Flex and Silverlight. |
How might one take advantage of this? I did it by designing a collection of applets that were each a single "control" running in its own thread, and communicating with other controls using inter-Thread data channels. (So you see, part 1 and part 2 of this series were not a waste of time.) At the highest level these applets appear as individual items on the page, so you can lay them out with HTML tags like you would lay out images or forms. However, unlike forms, applets can interoperate without constraint. A typical form might appear in HTML as follows: |
The navigator applet operates by opening a window displaying a list of the Web site contents. Users can easily navigate this list and select pages; the navigator displays further information about each selected page, and offers the user an option of opening up the selected page in a browser window. |
Java gives you the ability to create four kinds of programs: applications, applets, hybrids, and servlets. I discuss the first three programs in this article. To learn more about servlets, please consult the Java 2 Platform, Enterprise Edition documentation. |
When system designers and developers set out to design Internet/intranet solutions, one key factor they must take into consideration is object passing. The ability to pass around objects without having to develop a line protocol greatly reduces software costs. Remote method invocation (RMI) supports the transparent transmission of objects to other nodes on a network. Once the object has been transmitted, the data is processed by the method you called. For example, suppose you have an object containing some data you need to get to the server. RMI will magically send this object to the server by locating the Java object on the server you wish to have act on this data. This process eliminates the need to develop a line protocol. For example: |
|
To understand why the new applet loading method is fast, you need to know why the current method is so slow. A given applet usually is composed of a number of Java .class files. For each of those class files, the class loader must open an individual socket connection from your browser to the server that the applet code resides on. So, if your applet is composed of 18 .class files, the browser must open at least 18 sockets so it can transfer each one of those files. The overhead to set up and tear down each of those connections is quite significant. For example, each connection set up requires a number of network packet round-trips, which greatly increases the overall latency (especially in these times of the increasingly congested 'Net). (For the nitty-gritty details of socket connection overhead, check out one of the weighty TCP/IP reference tomes.) |
This article, the third in the series, will cover the various requirements for securely running Java code downloaded from a network. Although mobile code is not a revolutionary concept, Java and the Internet present some unique challenges to computer security. The evolution of the Java architecture and its impact on core Java security was discussed in Parts 1 and 2. This article takes a different tack: a hands-on approach to tie all the concepts together by deploying a simple applet that writes to the local filesystem. |
Once the darling of the Internet, applets have fallen on hard times, largely ignored in favor of newer technologies such as Ajax, Flex/Flash, and Silverlight. But Sun Microsystems is pushing hard for renewal on the client side, and some say applets are part of that vision, along with Java SE 6 update 10 and JavaFX Script. Is it too late for applets, or can they make a comeback? In this JavaWorld feature, Jeff Friesen poses that question to leading thinkers and doers in the Java developer community, as well as presenting his own conclusions. Also see "The new applet experience," a short experiment in developing a "rich Internet applet" using JavaFX Script and key technologies found in Java SE 6u10. |
Using HTTP as the communication protocol and a servlet peer for database queries, you can write a rich-content user interface applet that can dynamically interact with a database, yet remain small enough in size to perform well. In last month's article, "Dynamic Database Access from Client-side JavaScript", we looked at an architecture for utilizing the services of an applet-servlet pair to provide dynamic database access for client-side JavaScript. |
The above factors, combined with increased high-performance microprocessors and Internet connections, make applets a more appealing alternative to delivering executable content. In this column, I'll focus on the latest release of the Java plug-in (version 1.3) and its support for RSA signed applets and dynamic trust management. |
Here, I propose an applet-based approach to persist HTTP state information on the client end that can replace some of the techniques discussed above. The idea is to distribute an applet to each client on the first HTTP request. This applet would be persisted as long as the conversation with the server, or according to the business logic. Each client's state information will be tracked using the applet at its own end. Between multiple pages of navigation, the applet would serve as a "session tracker." The applet will be disposed when the conversation is over with the server according to the business logic (for example, the checkout option on an e-shopping site) or when the user closes the browser. |
This article describes multi-threaded programming by presenting an example slide show applet. The images for the slide show applet are thumbnails of paintings by Claude Monet downloaded from a public web site. If Claude Monet were alive today, the thumbnails and slide show applet might very well be available from his own web site so prospective buyers can view his latest works and make electronic purchases. |
Starting in Java SE 6 Update, the new Java Plug-in includes a draggable feature for applets. This feature allows users to bring together their browser and desktop experience. |
It's time to take another look at Java applet technology for delivering your programs over the web. The Next-Generation Java Plug-in Technology runs applets in a different, more efficient and more reliable way than ever before. Now you can reap the following benefits: |
Have you ever asked, "What is the difference between an applet and an application?" Or, "How do you turn an applet into a standalone application?" If so, then you are by no means alone; these questions are often asked, and the intention of this article is to help dispel the confusion behind these questions. |
The Inner Float applet, included below, lets you experiment with the IEEE 754 floating point format. This applet accompanies Chapter 14, "Floating Point Arithmetic," of Inside the Java 2 Virtual Machine. |
The Inner Int applet, included below, lets you experiment with the two's-complement format of integers in the Java virtual machine. This applet accompanies Chapter 12, "Integer Arithmetic," of Inside the Java 2 Virtual Machine. |
The Heap of Fish applet, included below, demonstrates a compacting, mark and sweep, garbage-collected heap. This applet accompanies Chapter 9, "The Garbage-Collected Heap," of Inside the Java 2 Virtual Machine. |
On the client side, a standard Web browser is operating in which Java applets for document signings of documents are executed (DigitalSignerApplet and SmartCardSignerApplet). |
This is exactly what unsuspecting users need to prevent an attack from a rogue Internet virus. But how is an honest software developer to create an applet that accesses multiple network hosts or saves a user's work or preferences to the local client? The answer is with digital signatures! |
Just after the applet is cleared, but before your stuff is redrawn, the applet is an empty square. After your stuff is redrawn, the applet is full of stuff. If this sequence of events happens often enough and/or if the delay between clearing and drawing is long enough, you'll see a flickering. |
Java can do anything, but it's good to let your Web browser take care of the display of text and images. Thus, you want most of your page to be created with HTML, and only those bits that need Java to be written in Java. But these Java-powered bits might be anywhere on your page. And since an applet only gets a single window, this means you have to use multiple applets. |
This article presents a technique for making your applets floatable ? that is, for giving the user the option to pop an applet into a floating window. And we'll design the API so that you can make your applet floatable with a minimum of fuss. |
Getting two or more applets within a single Web page to talk to each other has some benefits. Although this applet capability has been around since the earliest version of Java, it's not often used, because there's more emphasis placed on getting applets to communicate with servers. |
In this article, we'll be creating an applet that contains other applets running inside of it. In doing so, we'll be exploring, in detail, the context in which an applet runs. |
For a programming language that downloads foreign code to run on an end user's machine, Java is extremely secure. Java's sandbox model, securitymanager(), language protocols, memory management, and class library all help work together to make running applets from the Web as safe as possible. However, no system is one hundred percent secure. |
While loading, Java applets appear on the Web page as a plain-jane gray box with little or no status information (unless you're looking at the status bar at the bottom of your browser's window). Even after a Web page has loaded (and the familiar Netscape or Explorer "loading" animation has stopped), a Java applet may still be loading. This can be a bit confusing to the person waiting for a Java applet. What's going on? Is it loading? Is it broken? Only the most experienced users are likely to know. And this is a big problem considering more than one user will probably get a little restless and jet off to a different page instead of waiting. |
First Things First... This tutorial deals with Java Applets. In order to see the example applet or to run this tutorial correctly, you must have a 32-bit platform computer system. Basically, you will require Windows 95 or a high level Macintosh Operating System (OS). Yes, Mac is a 32-bit OS, but earlier versions of the Mac OS will not run Java applets. You will also require a browser that has Java capabilities. This will not work on Windows 3.x--even with the 32-bit extension software. |
Creating trusted applets with the access rights to the local clients' file system, even to this day remains a vital topic. A number of problems, by virtue of the specificity, can be executed only on the client side. Quite often, programmers unfamiliar with trusted applets technology accept it as an impossibility to work with client files and search for other ways to work. However, such ways exist and can be widely used in most variations. In this article, I will show you the example of how to create a simple trusted applet that will gain access to a local text file, which you will specify. (Please note that you will need to use JDK 1.3 or higher.) |
You can write code using Notepad or MSDOS Editor (supply EDIT Command at the DOS prompt). However, Notepad is the most preferred editor among most programmers. Save your files with .java extensions. Compile the program using javac .java. Execute your applet using the appletviewer utitlity included with the JDK or open the corresponding htm or htm file in a browser. |