• 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Running Applets in Browser...

 
Greenhorn
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...


Test.java
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);
}
}

Test.html

<html>
<body bgcolor = '#0000ff'>
<applet code="Test.class" width="300" height="300">
</applet>
</body>
</html>
 
Saloon Keeper
Posts: 22111
151
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.
 
I was born with webbed fish toes. This tiny ad is my only friend:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic