Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Running Applets in Browser...

Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having the problem of running the below applet in the browser. I know that we have to sign the applet using Policy tool. I am not getting a clear picture of how to do that?
We are having command in Policy tool to do so. I have tried to sign the applet using the instructions given in website of Sun. But I couldn't achieve.

I would like to know the following,
1) What extent we can use the applet in Web without signing it? (With minimum features)
2) Is there anyother GUI based tool to do the same?
3) Will you pls send me the detailed info about how to make enable a applet using Policy Tool?
4) Is there any extra security coding necessary in the program?

Pls send me the detailed docs or procedures or samples for making the Applet work in browser...
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Test extends JApplet
public void init()
Container contentPane = getContentPane();

// I dont want to use ImageIcon
// ImageIcon i = new ImageIcon(getImage(getCodeBase(), "swing.gif"));

Icon i = new ImageIcon("swing.gif","An animated GIF of Duke on a swing");

JLabel label = new JLabel("Swing!",i,SwingConstants.CENTER);

contentPane.add(label, BorderLayout.CENTER);


<body bgcolor = '#0000ff'>
<applet code="Test.class" width="300" height="300">
Saloon Keeper
Posts: 22275
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't have to sign applets unless they want to:
1. access local files
2. print
3. talk to network hosts other than the one they were downloaded from
4. use JDBC
There may be a few others I've forgotten, but these are the most common uses.
9 times out of 10 people want to sign applets because they want to do one or more of the 4 items listed above. In actuality, they usually shouldn't be doing so, because you get better security and enterprise support by using a 3-tier app design and collaborating with the webapp's host server.
    Bookmark Topic Watch Topic
  • New Topic