import java.awt.*;
import java.applet.*;
public class conlse extends java.applet.Applet
{
/** Initialization method that will be called after the applet is loaded
* into the browser.
*/
Label able;
Button nu;
Checkbox xz;
Checkbox rb1,rb2,rb3;
CheckboxGroup crg;
Choice te;
TextField text ;
public void init()
{
// TODO start asynchronous download of heavy resources
setLayout(new FlowLayout());
able=new Label("This is a staca");
add(able);
nu=new Button("ok");
add(nu);
xz=new Checkbox("checkboxes are for boolean value");
add(xz);
crg=new CheckboxGroup();
rb1=new Checkbox("rbutton1",crg,true);
rb2=new Checkbox("rbutton2",crg,false);
rb3=new Checkbox("rbutton3",crg,false);
add(rb1);
add(rb2);
add(rb3);
te=new Choice();
te.addItem("one");
te.addItem("two");
te.addItem("three");
te.addItem("four");
add(te);
text=new TextField (30);
add(text);
}
public boolean action(Event evt,Object arg)
{
if(evt.target instanceof Button)
{
System.out.print("Button control=");
System.out.println(arg);
}
else
if(evt.target instanceof Checkbox)
{
System.out.print("Checkbox.label=");
String d=((Checkbox)evt.target).getLabel();
System.out.println(d);
System.out.print("Amp=");
System.out.println(arg);
}
else
if(evt.target instanceof Choice)
{
System.out.print("Choice box=");
System.out.println(arg);
}
else
if(evt.target instanceof TextField)
{
System.out.print("Textfield action.Argument=");
System.out.println(arg);
}
return true ;
}
}
<html>
<head>
</head>
<body bgcolor="000000">
To see control action,open tava Console.<p>
Samdjahdjkdfkjfdkfkdjfdkf dfkd:<p><p>(请问上面2句话为什么不显示在HTML页面上啊)
<applet
code = "conlse.class"
width = "500"
height = "300"
>
</applet>
</body>
</html>
怎么做可以显示啊