hi,
I am creating an
applet using swing.I am working on linux.
In the code below , when I click on JComboBox CB1 and consequently call the dut.show() method I get the following exception
"java.security.AccessControlException access denied (java.io.FilePermission /home/ganesh/test/j2sdk_nb/bin read)
at java.security.AccessController.checkPermission(AccessControlContext
java :line number)
and so on ....................."
I checked the directory for permissions and found them to be ok.
Please suggest a solution to overcome this issue.
regards,
ganesh.
public class HelloWorld2 extends JApplet implements ActionListener {
JFrame a = new JFrame("Deembed");
String data[] = { "trans" , "ind" , "kap" , "line" , "none"};
FileDialog open_file = new FileDialog(a, "-open" , FileDialog.LOAD);
FileDialog thr = new FileDialog(a, "-short - thru" , FileDialog.LOAD);
FileDialog dut = new FileDialog(a, "DUT" , FileDialog.LOAD);
JComboBox CB2 = new JComboBox();
public void init()
{
JComboBox CB1 = new JComboBox(data);
CB1.addActionListener(this);
CB2.addActionListener(this);
this.getContentPane().add(CB1);
this.getContentPane().add(CB2);
this.getContentPane().setLayout(new FlowLayout());
}
public void actionPerformed(ActionEvent e) {
JComboBox cb = (JComboBox)e.getSource();
// String data1 = (String)cb.getSource();
System.out.println(cb.getSelectedItem());
//process : Add data to CB2
if(cb.getSelectedItem() == "ind" ) {
CB2.removeAllItems();
CB2.addItem("-ind");
CB2.addItem("none");
dut.show();
}
else if (cb.getSelectedItem() == "kap"){
CB2.removeAllItems();
CB2.addItem("-kap");
CB2.addItem("none");
dut.show();
}
else if ( cb.getSelectedItem() == "trans"){
CB2.removeAllItems();
CB2.addItem("-e");
CB2.addItem("-c");
CB2.addItem("-ipol");
CB2.addItem("-l");
CB2.addItem("none");
dut.show();
}
else if ( cb.getSelectedItem() == "line"){
CB2.removeAllItems();
CB2.addItem("-line");
CB2.addItem("none");
dut.show();
}
}
}