a***a 发帖数: 974 | 1 不好意思, 又是高中生的题目, 不过我请了两个写程序的高手, 都没找到第二个错!
Here is the code for a simple applet. It doesn't compile, due to two big,
glaring errors in the code. Find the error and explain why it's a mistake.
Then say how you would change the code to fix the error.
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Color;
import java.awt.Label;
public class ExamApplet1 extends Applet {
Graphics g;
boolean ready=false;
Label questionLabel = new Label("What is this thing?");
questionLabel.setSize(2 | n******r 发帖数: 294 | 2 too low-land de le ba
put questionLabel.setSize(25,40);
inside
public void init()
{}
【在 a***a 的大作中提到】 : 不好意思, 又是高中生的题目, 不过我请了两个写程序的高手, 都没找到第二个错! : Here is the code for a simple applet. It doesn't compile, due to two big, : glaring errors in the code. Find the error and explain why it's a mistake. : Then say how you would change the code to fix the error. : import java.applet.Applet; : import java.awt.Graphics; : import java.awt.Color; : import java.awt.Label; : public class ExamApplet1 extends Applet { : Graphics g;
| S*********g 发帖数: 5298 | 3 Exaclty.
My solutions is to put it in
public ExamApplet1()
{
questionLabel.setSize(25,40);
}
【在 n******r 的大作中提到】 : too low-land de le ba : put questionLabel.setSize(25,40); : inside : public void init() : {}
| a***a 发帖数: 974 | 4 谨向NoWonder, SuperString 致敬!
!
big,
mistake.
【在 S*********g 的大作中提到】 : Exaclty. : My solutions is to put it in : public ExamApplet1() : { : questionLabel.setSize(25,40); : }
| z****g 发帖数: 2497 | 5 find in 1 mins.
setBackground(Color.black)
if(ready = true)
【在 a***a 的大作中提到】 : 不好意思, 又是高中生的题目, 不过我请了两个写程序的高手, 都没找到第二个错! : Here is the code for a simple applet. It doesn't compile, due to two big, : glaring errors in the code. Find the error and explain why it's a mistake. : Then say how you would change the code to fix the error. : import java.applet.Applet; : import java.awt.Graphics; : import java.awt.Color; : import java.awt.Label; : public class ExamApplet1 extends Applet { : Graphics g;
| h****e 发帖数: 2125 | 6 O faint! Tutorial example??
【在 a***a 的大作中提到】 : 不好意思, 又是高中生的题目, 不过我请了两个写程序的高手, 都没找到第二个错! : Here is the code for a simple applet. It doesn't compile, due to two big, : glaring errors in the code. Find the error and explain why it's a mistake. : Then say how you would change the code to fix the error. : import java.applet.Applet; : import java.awt.Graphics; : import java.awt.Color; : import java.awt.Label; : public class ExamApplet1 extends Applet { : Graphics g;
|
|