Signed Applets
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vikas_Nijhawan
Posted On:   Saturday, June 1, 2002 04:17 AM

Hi, I have followed all the steps required for signing the applet and written the following code. But when I compile I get the error at lines 7 and 8 stating that security package is not found.Can u just tell which classes of SDK tool or something else I have to set at the classpath. The code is : import java.awt.*; import java.awt.event.*; import java.net.*; import java.applet.*; import javax.swing.*; import javax.swing.event.*; import com.ms.security.*; import com.ms.security.permission.*; /** * A very simple applet. */ public class MyApplet extends JApplet implements ActionListener{ JButton button; pu   More>>

Hi,
I have followed all the steps required for signing the applet and written the following code.
But when I compile I get the error at lines 7 and 8 stating that security package is not
found.Can u just tell which classes of SDK tool or something else I have to set at the
classpath. The code is :

import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.applet.*;
import javax.swing.*;
import javax.swing.event.*;
import com.ms.security.*;
import com.ms.security.permission.*;

/**
* A very simple applet.
*/
public class MyApplet extends JApplet implements ActionListener{

JButton button;

public void init() {

// Force SwingApplet to come up in the System L&F
String laf = UIManager.getSystemLookAndFeelClassName();
try {
UIManager.setLookAndFeel(laf);
// If you want the Cross Platform L&F instead, comment out the above line and
// uncomment the following:
// UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException exc) {
System.err.println("Warning: UnsupportedLookAndFeel: " + laf);
} catch (Exception exc) {
System.err.println("Error loading " + laf + ": " + exc);
}

getContentPane().setLayout(new FlowLayout());
button = new JButton("Hello, I'm a Swing Button!");
button.addActionListener(this);
getContentPane().add(button);
}

public void actionPerformed(ActionEvent ae) {

System.out.println("SSSSSSSSSS");
try {
if (Class.forName("com.ms.security.PolicyEngine") != null)
PolicyEngine.assertPermission(PermissionID.SYSTEM);
} catch (Throwable cnfe) {
System.out.println("PermissionID Error : " + cnfe);
}


FileDialog m_fileOpenDlg = new java.awt.FileDialog(new Frame());
m_fileOpenDlg.setMode(FileDialog.LOAD);
m_fileOpenDlg.setTitle("Test file Dialog");
m_fileOpenDlg.setSize(new Dimension(250, 200));
m_fileOpenDlg.show();
System.out.println("AAAAAAAAAA");

}

public void stop() {
if (button != null) {
getContentPane().remove(button);
button = null;
}
}
}

Thanx and Regards,
Vikas

   <<Less

Re: Signed Applets

Posted By:   Laxman_Subramanian  
Posted On:   Sunday, June 2, 2002 12:05 PM

Hi ,

I believe you have not set the com.ms package in your classpath . If you have downloaded Microsoft SDK package please set the jar files in lib, in the classpath.incase you still have difficulty finding the jar files. Please mail me and I will send in the jar file thorugh email.
About | Sitemap | Contact