In the following code that uses a Swing GUI, which line has an error?
1 public class TestApplet extends Applet
2 {
3 public void init()
4 {
5 JLabel label = new JLabel("Test label") ;
6 setLayout(new FlowLayout() ) ;
7 add(label) ;
8 }
9 }
A) 1
B) 3
C) 5
D) There are no errors.
Correct Answer:
Verified
Q32: In an applet, events are handled:
A) with
Q33: If an applet attempts to violate one
Q34: Given the following code, how many times
Q35: Which of the following sound file formats
Q36: One way of viewing the results of
Q38: Look at the following applet code:
1 import
Q39: The _ object is responsible for drawing
Q40: Hypertext can contain:
A) a Java application program
B)
Q41: For all Swing components EXCEPT JApplet and
Q42: Whenever you need a component of any
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents