紧急求助!!! 我有,QQ:12318872MAIL:[email protected] 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我有,QQ:12318872mail:[email protected] package communication;import java.awt.*;import java.awt.event.*;import java.applet.*;import javax.swing.*;import java.util.*;import java.io.*;import java.net.*;import javax.swing.text.*;import java.net.URL;public class Applet1 extends Applet { boolean isStandalone = false; URL url; String uri = "init"; String servletAddress = "init"; String urlS = "init"; String uriS ="init"; String sqlAptToSvl=""; /**Get a parameter value*/ public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } /**Initialize the applet*/ public void init() { try { jbInit(); readCfgByParameter() ;connectServlet(servletAddress); } catch(Exception e) { e.printStackTrace(); } } /**Component initialization*/ private void jbInit() throws Exception { } /**Get Applet information*/ public String getAppletInfo() { return "Applet Information"; } /**Get parameter info*/ public String[][] getParameterInfo() { return null; } public void connectServlet(String s){ if (s.length() == 0){ return; } try{ java.net.URL url = new java.net.URL (s); java.net.URLConnection con = url.openConnection() ; //intialize the connection con.setUseCaches(false) ; con.setDoOutput(true) ; con.setDoInput(true) ; ObjectInputStream in = new ObjectInputStream(con.getInputStream() ); //read the data sqlAptToSvl = in.readUTF(); URL myURL=new URL(getCodeBase(),sqlAptToSvl); in.close(); Object o=myURL.getContent();System.out.println(sqlAptToSvl); } catch (Exception e){ e.printStackTrace(); return; } } public String readCfgByParameter() { byte buffer[] = new byte[2056]; try { InputStream fileIn= new FileInputStream("conSer.cfg"); int bytes = fileIn.read(buffer, 0, 2056); String strFile = new String(buffer, 0, bytes, "Default"); servletAddress = strFile; System.out.println(strFile) ; return servletAddress; }catch(Exception e){ return "Read config file failed!"; } } } 遇到一个Set装入重复元素的问题 file标签获取文件路径 在网页上插入一个JApplet 可是无法显示 java中二叉树删除节点问题(假设只删除一个) MySQL or ACCESS 看例子!!! 高分求关于java调用windows directx播放mpeg4或h.264相关文档 请教Jbuilder、java和javaScript有什么区别? 请问关于路径设置的问题 一个小问题~~`大家来看看咯~`` 请问oracle8.05的jdbc驱动程序在哪里可以找到? 求助一个方法,简单阿!!!!!有关删除文件夹的
mail:[email protected]
import java.awt.event.*;
import java.applet.*;import javax.swing.*;
import java.util.*;
import java.io.*;
import java.net.*;
import javax.swing.text.*;
import java.net.URL;public class Applet1 extends Applet {
boolean isStandalone = false; URL url;
String uri = "init";
String servletAddress = "init";
String urlS = "init";
String uriS ="init";
String sqlAptToSvl="";
/**Get a parameter value*/
public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
} /**Initialize the applet*/
public void init() {
try {
jbInit();
readCfgByParameter() ;
connectServlet(servletAddress);
}
catch(Exception e) {
e.printStackTrace();
}
}
/**Component initialization*/
private void jbInit() throws Exception {
}
/**Get Applet information*/
public String getAppletInfo() {
return "Applet Information";
}
/**Get parameter info*/
public String[][] getParameterInfo() {
return null;
} public void connectServlet(String s){
if (s.length() == 0){
return;
}
try{
java.net.URL url = new java.net.URL (s);
java.net.URLConnection con = url.openConnection() ; //intialize the connection
con.setUseCaches(false) ;
con.setDoOutput(true) ;
con.setDoInput(true) ; ObjectInputStream in = new ObjectInputStream(con.getInputStream() );
//read the data
sqlAptToSvl = in.readUTF();
URL myURL=new URL(getCodeBase(),sqlAptToSvl);
in.close();
Object o=myURL.getContent();System.out.println(sqlAptToSvl);
}
catch (Exception e){ e.printStackTrace();
return;
} } public String readCfgByParameter() { byte buffer[] = new byte[2056]; try { InputStream fileIn= new FileInputStream("conSer.cfg");
int bytes = fileIn.read(buffer, 0, 2056); String strFile = new String(buffer, 0, bytes, "Default");
servletAddress = strFile;
System.out.println(strFile) ;
return servletAddress; }catch(Exception e){
return "Read config file failed!";
} } }