magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1998 > 09 > Java@Work  

Bridging the Communications Gap

The Internet is all about communications, right? So why is it that most Java applets lead solitary lives? What could you do with Java applets that could talk to other applets? How about communicating back to the server? It's possible to make both kinds of applets with a minimum of fuss by using the AppletContext object from inside your applet.

This month I'll show you how to create applets that can cooperate with each other and simply communicate with the server. Along the way, you'll see a few tricks for handling fonts, and disabling layout managers.

Take a look at Figure 1. This Web page contains two different applets and some HTML. The first applet displays one of several palindromes (phrases that spell the same forwards or backwards). The second applet looks like a regular form button, but it signals the first applet to advance to the next palindrome. If the first applet realizes it has run out of palindromes, it signals the server to load a new Web page (presumably one with more palindromes). The applet also displays a custom status message in the browser's status bar. Just for fun, I put a second copy of the first applet at the bottom of the page.

The AppletContext

All of this is possible because of the AppletContext interface (see



  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2