倒,Applet怎么能用java Example1_2来运行???Applet应当包含在网页里面或用AppletViewer 网页来运行的;)
2、HelloWorld.java
//Name:HelloWorld.java
//Memo:经典程序HellWorldimport java.awt.Graphics;
import java.applet.*;public class HelloWorld extends java.applet.Applet
{
public void init()
{
resize(150,50);
} public void paint(Graphics g)
{
g.drawString("Hello Java World !!!",150,50);
}
}3、HelloWorld.html
<html><head>
<title>Java Applet......HelloWorld</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="pragma" content="no-cache">
</head><body bgcolor="#FFFFFF">
<center>
<applet code="HelloWorld.class" width="500" height="400">
</applet>
</center>
</body>
</html>还有就是编译时
javac -target 1.1 **.java
2、HelloWorld.java
//Name:HelloWorld.java
//Memo:经典程序HellWorldimport java.awt.Graphics;
import java.applet.*;public class HelloWorld extends java.applet.Applet
{
public void init()
{
resize(150,50);
} public void paint(Graphics g)
{
g.drawString("Hello Java World !!!",150,50);
}
}3、HelloWorld.html
<html><head>
<title>Java Applet......HelloWorld</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="pragma" content="no-cache">
</head><body bgcolor="#FFFFFF">
<center>
<applet code="HelloWorld.class" width="500" height="400">
</applet>
</center>
</body>
</html>还有就是编译时
javac -target 1.1 **.java
解决方案 »
- cookie没保存在C:\Documents and Settings\用户名\Cookies
- 急救~~~~~怎么用url类实现访问带session的两个页面?????????
- 求高手帮忙 在线等 急啊
- -sourcepath问题
- 高难问题:我要在Canvas上画副图.不允许从Canvas派生子类来实现.
- 解决画面停止的问题
- socket的问题,收到的数据有丢失现象?回答者有分。
- 如何把date类型的时间转换成GregorianCalendar类型的时间?
- java繁简体问题,哪位高手如有时间,帮我看一下怎么解决!!!!
- 有关WINDOW
- RandomAccessFile写入的文件格式?
- 请问在java中有没有和System.out.println()所对应的输入函数。
可否:
<html>
<applet code="Example1_2.class(假设我的Example1_2.class保存在c:\myhomework下那么我这里是不是要写全目录?????)" width="500" height="400">
</applet>
</html>
还有编译时,不能直接 javac Example1_2.java 吗?