S
SevenOrient
Unregistered / Unconfirmed
GUEST, unregistred user!
:俺初学Java,有个问题请教,写了一段Java小程序(看里面),为什么没有运行结果:
package buttontest;
import java.awt.*;
import java.applet.*;
public class AppletButton extends Applet{
Button myButton1,myButton2;
public void Init() {
myButton1=new Button();
myButton1=new Button("Button2");
myButton1.setLabel("Button1");
add(myButton1);
add(myButton2);
myButton2.setEnabled(false);
validate();
}
}
首先,我用JBuilder5新建个Applet,写完代码运行。显示:Applet已启动,但是,没有
其他效果呀?为什么呀?
package buttontest;
import java.awt.*;
import java.applet.*;
public class AppletButton extends Applet{
Button myButton1,myButton2;
public void Init() {
myButton1=new Button();
myButton1=new Button("Button2");
myButton1.setLabel("Button1");
add(myButton1);
add(myButton2);
myButton2.setEnabled(false);
validate();
}
}
首先,我用JBuilder5新建个Applet,写完代码运行。显示:Applet已启动,但是,没有
其他效果呀?为什么呀?