由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Re: 关于APPLET的IO问题
相关主题
what's wrong with this simple applet? (转载)getImage有个问题
新手请教一个问题求救求救 JSObject的getWindow为什么总是返回null呀~
Java Resource一问不明白servlet, applet到底啥区别,还有jsp
Help: 小程序挑错Re: print problem, GUI guru please come in
新手求教JTextField的问题Re: access host file in applet
Re: Why my url can not open a connection to my servlet in a web browseAuthenticated Applet Doesn't Show in VBApp
[转载] Java版诚招版副Re: Display, edit, and save Image on HTM
PersonalJava and Http tunneling问java applet的问题
相关话题的讨论汇总
话题: applet话题: import话题: url话题: code
进入Java版参与讨论
1 (共1页)
l******d
发帖数: 1
1
我试了一下,没问题呀。就是IE5的VM好像不合spec,getDocumentBase()连文件名都返回了。所以做了点改动。这是我试验的Code,你参考一下。
MyApplet.java:
import java.io.*;
import java.net.*;
import java.awt.*;
import java.applet.*;
public class MyApplet extends Applet
{
public void init()
{
setLayout(null);
setSize(426,266);
add(textArea1);
textArea1.setBounds(20,20,600,440);
textArea1.setText(getDocumentBase()+"\n");
try {
URL url = new URL(getDocumentBase(), "text.txt");
textArea1.setText(url.toString()+"\n");
URLConnection conn = url.openConnection()
x***n
发帖数: 291
2
You may edit a policy file by yourself to grant certain
permission. Then use the command:
appletviewer -J-Djava.security.policy=MyPolicyFile.txt MyApplet.html
to test ur code.
If you want to deploy your applet via web-browser, signing
code is a better alternative, i think.
goodluck
1 (共1页)
进入Java版参与讨论
相关主题
问java applet的问题新手求教JTextField的问题
Java笔试题分享-NetworkingRe: Why my url can not open a connection to my servlet in a web browse
applet如何从jar:file:或者jar:http:读入文件[转载] Java版诚招版副
java applet读网络文件的问题PersonalJava and Http tunneling
what's wrong with this simple applet? (转载)getImage有个问题
新手请教一个问题求救求救 JSObject的getWindow为什么总是返回null呀~
Java Resource一问不明白servlet, applet到底啥区别,还有jsp
Help: 小程序挑错Re: print problem, GUI guru please come in
相关话题的讨论汇总
话题: applet话题: import话题: url话题: code