Exam 14: Applets and More
Exam 1: Introduction to Computers and Java51 Questions
Exam 2: Java Fundamentals61 Questions
Exam 3: Decision Structures64 Questions
Exam 4: Loops and Files57 Questions
Exam 5: Methods60 Questions
Exam 6: A First Look at Classes58 Questions
Exam 7: Arrays and the Arraylist Class64 Questions
Exam 8: A Second Look at Classes and Objects50 Questions
Exam 9: Text Processing and More About Wrapper Classes60 Questions
Exam 10: Inheritance70 Questions
Exam 11: Exceptions and Advanced File IO56 Questions
Exam 12: A First Look at GUI Applications60 Questions
Exam 13: Advanced GUI Applications58 Questions
Exam 14: Applets and More54 Questions
Exam 15: Creating GUI Applications With Javafx and Scene Builder40 Questions
Exam 16: Recursion42 Questions
Exam 17: Databases48 Questions
Select questions type
Which of the following is NOT a restriction placed on applets?
(Multiple Choice)
4.9/5
(34)
The browser creates an instance of the applet class automatically.
(True/False)
4.9/5
(45)
The delay parameter in the Timer constructor is the amount of time between action events, measured in microseconds.
(True/False)
4.9/5
(39)
If an applet attempts to violate one of the JVM restrictions:
(Multiple Choice)
4.8/5
(39)
The delay parameter in the Timer constructor is the amount of time between action events, measured in milliseconds.
(True/False)
4.9/5
(41)
Look at the following applet code. 1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 int[] xCoords = {20, 20, 60, 100, 140, 140, 100, 60};
12 int[] ycoords = {20, 100, 140, 140, 100, 60, 20, 20};
13 super.paint(g);
14 g.setColor(Color.YELLOW);
15 g.fillPolygon(xCoords, yCoords, 8);
16 g.setColor(color.BLACK);
17 g.setFont(new Font("SansSerif", Font.BOLD, 35));
18 g.drawString("SLOW", 35, 95);
19 }
20 }
What will be the coordinates of the third point of the polygon?
(Multiple Choice)
4.8/5
(44)
The play method will load and play a sound file once, then release it for garbage collection. The getAudioClip method will load the sound file and may assign the location of the sound file to a variable so it may be invoked many times.
(True/False)
4.9/5
(39)
In the following code, what does getDocumentBase()return?
Play(getDocumentBase(), "mysound.wav");
(Multiple Choice)
4.8/5
(42)
Whenever you need a component of any type to be painted, call the paint method.
(True/False)
4.8/5
(35)
When the applet viewer opens an HTML document with more than one applet tag:
(Multiple Choice)
4.8/5
(43)
Look at the following applet code:
1 import javax.swing.*;
2 import java.awt.*;
3 public class GraphicsTest extends JApplet
4 {
5 public void init()
6 {
7 getContentPane().setBackground(Color.WHITE);
8 }
9 public void paint(Graphics g)
10 {
11 super.paint(g);
12 g.setColor(Color.YELLOW);
13 g.fillOval(100, 100, 50, 50);
14 g.setColor(Color.BLACK);
15 g.setFont(new Font("SansSerif", Font.BOLD, 35));
16 g.drawString("SLOW", 110, 110);
17 }
18 }
Which line sets the color that will be used to draw "SLOW"?
(Multiple Choice)
4.9/5
(39)
Given the following code, how many times per second will the TimerListener event be generated?
Timer timer = new Timer(500, new TimerListener());
(Multiple Choice)
4.9/5
(42)
When you extend an interface, you must implement all the methods defined in the interface. If you are interested in only one or two mouse events, you can extend the ________ class which implements the MouseListener interface, but does not require you to write all the functions in the interface.
(Multiple Choice)
4.8/5
(47)
To support the Swing classes in applets, some browsers require a ________, which is software that extends or enhances another program.
(Multiple Choice)
4.8/5
(47)
The Applet class requires that you write a constructor to create an object of the class.
(True/False)
4.9/5
(44)
Showing 21 - 40 of 54
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)