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
A mouse motion listener class can respond to:
Free
(Multiple Choice)
4.8/5
(44)
Correct Answer:
C
An applet using a Swing GUI is extended from this class.
Free
(Multiple Choice)
4.8/5
(31)
Correct Answer:
D
What does the tag <p /> cause to happen?
Free
(Multiple Choice)
5.0/5
(34)
Correct Answer:
B
HTML describes the content and layout of a Web page, and creates links to other files and Web pages, but does not have sophisticated abilities such as performing math calculations and interacting with the user.
(True/False)
4.8/5
(45)
Which of the following sound file formats does Java not support?
(Multiple Choice)
4.9/5
(35)
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 }
(Multiple Choice)
4.7/5
(35)
These are Java programs that are usually part of a Web site.
(Multiple Choice)
4.8/5
(39)
If a frame component is 300 pixels wide and 200 pixels high, the upper, right-hand corner has (X, Y) coordinates of:
(Multiple Choice)
4.8/5
(44)
What will happen if you use instead of in an HTML document?
(Multiple Choice)
4.9/5
(30)
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 }
How many vertices does the polygon have?
(Multiple Choice)
4.8/5
(38)
One way of viewing the results of the applet which is invoked in the HTML document TestApplet.html is to enter the following at the command prompt.
(Multiple Choice)
4.9/5
(39)
An applet does not have to be on a Web server in order to be executed.
(True/False)
4.8/5
(37)
Some browsers do not directly support the Swing classes of applets.
(True/False)
4.8/5
(41)
The ________ object is responsible for drawing the entire applet window.
(Multiple Choice)
4.7/5
(36)
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 is the color of the polygon?
(Multiple Choice)
4.8/5
(30)
Showing 1 - 20 of 54
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)