Redian新闻
>
One question about Java Programming
avatar
One question about Java Programming# Java - 爪哇娇娃
x*y
1
hi,
I am writing an Applet file A.java using Java. I put A.java in the linux
operating system and use IE to run the applet.
My question is:
in A.java, there is one line:
JButton increase = new JButton (new ImageIcon ("increase.gif"));
I do have increase.gif at the same directory of A.java. However, when I run
this applet, I got :
java.security.AccessControlException: access denied (java.io.FilePermission
increase.gif read)
What is wrong?
Thanks for the information
avatar
o*g
2
说实话,这个东西很少有人用的。
检查一下文件属性。

(

【在 x****y 的大作中提到】
: hi,
: I am writing an Applet file A.java using Java. I put A.java in the linux
: operating system and use IE to run the applet.
: My question is:
: in A.java, there is one line:
: JButton increase = new JButton (new ImageIcon ("increase.gif"));
: I do have increase.gif at the same directory of A.java. However, when I run
: this applet, I got :
: java.security.AccessControlException: access denied (java.io.FilePermission
: increase.gif read)

avatar
g*g
3
you can't do this, try to read it as a stream.

【在 x****y 的大作中提到】
: hi,
: I am writing an Applet file A.java using Java. I put A.java in the linux
: operating system and use IE to run the applet.
: My question is:
: in A.java, there is one line:
: JButton increase = new JButton (new ImageIcon ("increase.gif"));
: I do have increase.gif at the same directory of A.java. However, when I run
: this applet, I got :
: java.security.AccessControlException: access denied (java.io.FilePermission
: increase.gif read)

avatar
w*r
4
security violation... cannot do this, applet cannot access local file system.
has to read the icon from a stream on server side.

【在 x****y 的大作中提到】
: hi,
: I am writing an Applet file A.java using Java. I put A.java in the linux
: operating system and use IE to run the applet.
: My question is:
: in A.java, there is one line:
: JButton increase = new JButton (new ImageIcon ("increase.gif"));
: I do have increase.gif at the same directory of A.java. However, when I run
: this applet, I got :
: java.security.AccessControlException: access denied (java.io.FilePermission
: increase.gif read)

avatar
x*y
5
Hi,
Thanks for your reply.
I forgot to mention that: A.java and increase.gif are put in a linux server (
Fedora), and I access it from another machine...
Thanks,
avatar
o*g
6
如果你是双击某个文件,来让他运行的,我不知道答案。
如果不是,increase.gif应该在服务器端。

【在 x****y 的大作中提到】
: hi,
: I am writing an Applet file A.java using Java. I put A.java in the linux
: operating system and use IE to run the applet.
: My question is:
: in A.java, there is one line:
: JButton increase = new JButton (new ImageIcon ("increase.gif"));
: I do have increase.gif at the same directory of A.java. However, when I run
: this applet, I got :
: java.security.AccessControlException: access denied (java.io.FilePermission
: increase.gif read)

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。