Originally posted by Michael Morris:
As Gregg said, Applets run in the "sandbox" with very limited access to system resources. The fact that the file permissions are set correctly doesn't do anything for you. The easiset way to handle this is to add a permission to the plugin policy file, java.policy, which is located in the lib/security subdirectory of the plugin's main directory. If your applet's codebase is http://www.mysite.com then you would add an entry like:
That will allow unfettered access to all system resources, which may not be what you want. You can limit it to specific permissions by using different permission types for example:
That would grant read permission to just the file "/home/ganesh/test/j2sdk_nb/bin.
Originally posted by ganeshjk krishnamurthy:
hi,
Thanks for the help. I tried your suggestions , but still am not able to get the result.Here is the code for ur perusal.import java.applet.*;
import java.lang.*;
import java.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class HelloWorld2 extends JApplet implements ActionListener {
Frame a = new Frame("Deembed");
String data_a[] = { "a" , "b" , "c" };
String data_b[] = { "d" , "e" , "f" };
String data_c[] = { "x" , "y", "z" };
String data[] = { "trans" , "ind" , "cap" };
JComboBox CB2 = new JComboBox(data_a);
public void init()
{
JComboBox CB1 = new JComboBox(data);
this.getContentPane().add(CB1);
this.getContentPane().add(CB2);
this.getContentPane().setLayout(new FlowLayout());
}
public void actionPerformed(ActionEvent e) {
JComboBox cb = (JComboBox)e.getSource();
String data = (String)cb.getSelectedItem();
//process : Add data to CB2
if(data == "ind") {
CB2.removeAllItems();
CB2.addItem(data_b);
}
else if (data== "cap"){
CB2.removeAllItems();
CB2.addItem(data_c);
}
}
}
thank you ,
regards,
ganesh.