aspose file tools*
The moose likes Servlets and the fly likes Hidden Applet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Hidden Applet?" Watch "Hidden Applet?" New topic
Author

Hidden Applet?

Dave Donohoe
Ranch Hand

Joined: May 16, 2000
Posts: 73
I have a Servlet that calls an applet like so
output.writeBytes("<APPLET CODE='DavesApplet.class' ARCHIVE='DDavesApplet.jar' WIDTH=50 HEIGHT=50 CODEBASE='/BEAT/applet/'>");
The applet then uses an ObjectInputStream to connect to the servlet & get a Vector from the servlet. All this works fine except that the contents of the vector get printed to the screen. How can I leave the window in the browser blank? Ideally, I would prefer not to have the gray box of the applet appear either.
D
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

In a properly written applet, the only way data - or anything else - is going to display is if the applet contains code to display it, so I have no idea why you have the first problem.
As to the second, Java was designed from the ground up with mischief-makers in mind, so normally a browser is not going to allow an applet to be totally invisible, either by explicit hiding or by the trick of putting it in a small (0x0 or 1x1) area - the idea is that the user should KNOW that there's active logic on the webpage. I believe that the JRE will actually refuse to start an applet if its physical display area is too small.


Customer surveys are for companies who didn't pay proper attention to begin with.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
You can have an applet in a frame that is offscreen. Make a frameset where one member gets 100% of the screen and the other contains the applet.
Bill
 
Don't get me started about those stupid light bulbs.
 
subject: Hidden Applet?