This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hidden Applet?

 
Dave Donohoe
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18162
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic