• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Running Applets in Browser...

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 28105
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
There is no greater crime than stealing somebody's best friend. I miss you tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic