http://localhost:8083/servlet/Applet1.html-->http://localhost:8083/Applet1.html
解决方案 »
- 有3年工作经验的请进
- 请教,TOMCAT下CAB无法安装运行。
- 使用Uploadbean上传文件进数据库的问题
- 请教在那里可以下载到apache的包??
- 各位高手!!帮我看看这几天做的一个后功能页面,给点意见看看应该怎改得更好~
- 急等,简单小问题
- 在做HTML页面的时候,超连接的alt href prompt属性是什么含义?
- 求救:如何在按钮的onclick事件中调用jsp的函数
- 很低级的问题:我装了jrun,但不知道怎么用
- "JspIxTutorial.jsp": org.apache.jasper.JasperException: No such tag in the tag library imported with prefix ix
- 采用struts提供的上传组件,上传一个excel文件后,中文乱吗,怎么解决
- resin + jfreechart 显示乱码(高分求救!)
从http://localhost:8083/servlet/hello访问到我的Applet1.java
---------------------------------------
package testjdbc;import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import org.jfree.chart.*;
import org.jfree.data.*;
import java.awt.image.*;
import javax.servlet.Servlet.*;
import javax.servlet.http.*;
import javax.servlet.*;
public class Applet1 extends Applet {
boolean isStandalone = false;
String var0;
//Get a parameter value
public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
} //Construct the applet
public Applet1() {
} public void paint(Graphics g){
DefaultPieDataset pieDataset = new DefaultPieDataset();
pieDataset.setValue("JavaWorld", new Integer(75));
pieDataset.setValue("Other", new Integer(25));
org.jfree.chart.JFreeChart chart1 = org.jfree.chart.ChartFactory.createPieChart("aaa",pieDataset,true,true,true);
BufferedImage image = chart1.createBufferedImage(500,300); g.drawImage(image,0,0,this);
super.paint(g);
}
//Initialize the applet
public void init() {
try {
jbInit();
}
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() {
String[][] pinfo =
{
{"name", "String", ""},
};
return pinfo;
}
}------------------------------------------
调用他的Applet1.html
------------------------------------------
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<title>
HTML Test Page
</title>
</head>
<body>
testjdbc.Applet1 will appear below in a Java enabled browser.<br/>
<applet
codebase = "."
code = "testjdbc.Applet1.class"
name = "TestApplet"
width = "400"
height = "300"
hspace = "0"
vspace = "0"
align = "top"
>
<param name = "name" value = "FreeChart">
</applet>
</body>
</html>