/* Main.java
*
* Created on 2006年11月30日, 下午7:13
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/package javaapplication1;
import java.applet.*;
import java.awt.*;/**
*
* @author gerc
*/
public class Main extends Applet{
private String str;
/** Creates a new instance of Main */
public Main() {
}
public void paint(Graphics g)
{
g.drawLine(12,50,90,100);
g.drawString(str,90,200);
}
/**
* @param args the command line arguments
*/ public void init()
{
str="Let's Begin the exciting tourial";
}
}然后再Index.html有这样的调用<htm>
<title>This is a test</title>
<body><Applet code="Main.class",width=200,height=600></Applet></body>
</htm>这么加载失败了?
*
* Created on 2006年11月30日, 下午7:13
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/package javaapplication1;
import java.applet.*;
import java.awt.*;/**
*
* @author gerc
*/
public class Main extends Applet{
private String str;
/** Creates a new instance of Main */
public Main() {
}
public void paint(Graphics g)
{
g.drawLine(12,50,90,100);
g.drawString(str,90,200);
}
/**
* @param args the command line arguments
*/ public void init()
{
str="Let's Begin the exciting tourial";
}
}然后再Index.html有这样的调用<htm>
<title>This is a test</title>
<body><Applet code="Main.class",width=200,height=600></Applet></body>
</htm>这么加载失败了?
解决方案 »
- 怎么能让spring框架加载加密后的.class文件啊?
- 网页中可以嵌入java控件吗?
- 在配置tomcat连接池的出错 Name jdbc is not bound in this Contextjdbc
- 百思不得其解的hibernate问题,表名无效~高手救急
- 动态页的静态化问题
- 如何用window.open打开窗口最大化?
- jsp比较好的数据库连接方式!!!
- 求jsp学习资源和方法?祝各位生活幸福美满!工作顺利!
- 请教................
- 又是一个白送分的问题!!在线等!!
- =====Tomcat的问题。请指点一下。=====
- 请教一个关于eclipse3.1引用swt的问题
* NewJApplet.java
*
* Created on 2006年12月2日, 上午10:53
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*//**
*
* @author BluePower
*
*/
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
public class NewJApplet extends javax.swing.JApplet {
/** Creates a new instance of NewJApplet */
String str;
public NewJApplet() {
}
public void paint(Graphics g)
{
Image img;
g.drawLine(20,50,90,100);
img=getImage(getCodeBase(),"d:\\image.JPG");
g.drawImage(img,0,0,this);
}
public void init()
{
str="Hello go on,baby";
}
}为什么显示不出图象来,我是用NETBEANS的APPLETVIEWER调试的