当前位置: 技术问答>java相关
我如何才能看到程序的结果
来源: 互联网 发布时间:2015-10-05
本文导语: import java.awt.*; import java.applet.*; public class LabeDemo extends Applet { public void init() { Label one = new Label("One"); Label two = new Label("Two"); Label three = new Label("Three"); add(one); add(two); add(three); } public static voi...
import java.awt.*;
import java.applet.*;
public class LabeDemo extends Applet
{
public void init()
{
Label one = new Label("One");
Label two = new Label("Two");
Label three = new Label("Three");
add(one);
add(two);
add(three);
}
public static void main(String args[])
{
LabeDemo mc = new LabeDemo();
mc.init();
}
}
import java.applet.*;
public class LabeDemo extends Applet
{
public void init()
{
Label one = new Label("One");
Label two = new Label("Two");
Label three = new Label("Three");
add(one);
add(two);
add(three);
}
public static void main(String args[])
{
LabeDemo mc = new LabeDemo();
mc.init();
}
}
|
先编译
javac LabeDemo.java
然后查看
appletviewer test.htm
********************
test.htm如下:
!?
把他们放在同一目录
javac LabeDemo.java
然后查看
appletviewer test.htm
********************
test.htm如下:
!?
把他们放在同一目录