import java.awt.*;
import java.awt.TextField;
import java.applet.Applet;public class StringMisc2 extends Applet
{
boolean bl = true; public void init ( )
{
/*TextField wo = new TextField ( " " , 10 );
add ( wo );*/
} public void paint ( Graphics g )
{
TextField wo = new TextField ( " " , 10 );
add ( wo );
} public boolean action ( Event e , Object o )
{
if ( bl == true )
{
showStatus ( "hahahaha" );
bl = false;
} else
{
showStatus ( "hehehehe" );
bl = true;
} return true;
}
}怎么图形用户界面显示不出来呀把它放在 init方法中就可以显示出来
import java.awt.TextField;
import java.applet.Applet;public class StringMisc2 extends Applet
{
boolean bl = true; public void init ( )
{
/*TextField wo = new TextField ( " " , 10 );
add ( wo );*/
} public void paint ( Graphics g )
{
TextField wo = new TextField ( " " , 10 );
add ( wo );
} public boolean action ( Event e , Object o )
{
if ( bl == true )
{
showStatus ( "hahahaha" );
bl = false;
} else
{
showStatus ( "hehehehe" );
bl = true;
} return true;
}
}怎么图形用户界面显示不出来呀把它放在 init方法中就可以显示出来
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货