M
Mik
I'm trying to redirect stream from console to JTextArea - it works in
JBuilder but when I run applet in IE I get:
java.security.AccessControlException: access denied
(java.lang.RuntimePermission setIO)
What should I do with it?
void redirect()
{
JFrame f = new JFrame();
final JTextArea a = new JTextArea();
a.setEditable(false);
f.getContentPane().add(new JScrollPane(a));
f.setSize(600,400);
f.setLocation(10,10);
f.show();
PrintStream s = new PrintStream(new OutputStream()
{
public void write(int b) {}
public void write(byte[] b,int off, int dl)
{
a.append(new String(b,off,dl));
}
});
System.setOut(s);
System.setErr(s);
}
JBuilder but when I run applet in IE I get:
java.security.AccessControlException: access denied
(java.lang.RuntimePermission setIO)
What should I do with it?
void redirect()
{
JFrame f = new JFrame();
final JTextArea a = new JTextArea();
a.setEditable(false);
f.getContentPane().add(new JScrollPane(a));
f.setSize(600,400);
f.setLocation(10,10);
f.show();
PrintStream s = new PrintStream(new OutputStream()
{
public void write(int b) {}
public void write(byte[] b,int off, int dl)
{
a.append(new String(b,off,dl));
}
});
System.setOut(s);
System.setErr(s);
}