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
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 }
What shape will the oval have?
(Multiple Choice)
4.9/5
(38)
Given the following code, how many times per second will the TimerListener event be generated?
Timer timer = new Timer(1000, new TimerListener());
(Multiple Choice)
4.8/5
(35)
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 }
What will be the coordinates of the center of the oval?
(Multiple Choice)
4.9/5
(30)
In the link produced by the following HTML, what word would you click to go to the linked location?
Click here to learn more about
<a href="http://www.applications.com">applications.</a>
(Multiple Choice)
4.9/5
(44)
If a frame component is 200 pixels wide and 300 pixels high, the lower, left-hand corner has (X, Y) coordinates of:
(Multiple Choice)
4.9/5
(40)
An HTML document is usually saved with what file name extension?
(Multiple Choice)
4.8/5
(44)
For all Swing components EXCEPT JApplet and JFrame, you should override the paintComponent method instead of the paint method.
(True/False)
4.7/5
(39)
If you want to make sure that an applet is compatible with all Java-enabled browsers, use Swing components instead of AWT.
(True/False)
4.7/5
(34)
In the following code, which line has an error?
1 public class TestApplet extends JApplet
2 {
3 public void init()
4 {
5 super.JApplet();
6 JLabel label = new JLabel("Test label");
7 setLayout(new FlowLayout());
8 add(label);
9 }
10 }
(Multiple Choice)
4.8/5
(27)
The following getAudioClip() method returns an object that will load the sound file and assign the location of that file to clip which can then be used to call methods that may play the sound file one or more times:
Audioclip clip = getAudioClip(getDocumentBase(), "mysound.wav");
(True/False)
4.8/5
(45)
Showing 41 - 54 of 54
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)