主题:怎么不在applet下方显示文本域和按钮?
//MyApplet.java
import java.applet.*;
import java.awt.*;
public class MyApplet extends Applet
{
public String text = "a";
public void init()
{
System.out.println("www.it315.org");
}
public void paint(Graphics g)
{
g.setFont(new Font(null,Font.ITALIC|Font.BOLD,30));
g.drawString(text,0,60);
}
}
//MyApplet.html
<applet
code=MyApplet
name ="app"
width=500
height=300
>
<param name=interval value=100>
<script language="javascript">
function setText()
{
document.app.text =content.value;
document.app.repaint();
}
</script>
<input type=text name=content>
<input type=button value="改变文本" onclick="setText()">
</applet>
怎么不在applet下方显示文本域和按钮?
import java.applet.*;
import java.awt.*;
public class MyApplet extends Applet
{
public String text = "a";
public void init()
{
System.out.println("www.it315.org");
}
public void paint(Graphics g)
{
g.setFont(new Font(null,Font.ITALIC|Font.BOLD,30));
g.drawString(text,0,60);
}
}
//MyApplet.html
<applet
code=MyApplet
name ="app"
width=500
height=300
>
<param name=interval value=100>
<script language="javascript">
function setText()
{
document.app.text =content.value;
document.app.repaint();
}
</script>
<input type=text name=content>
<input type=button value="改变文本" onclick="setText()">
</applet>
怎么不在applet下方显示文本域和按钮?