Exam 14: Applets and More

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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)

Due to security restrictions, applets cannot:

(Multiple Choice)
4.8/5
(31)

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)

Which of the following can a mouse listener respond to?

(Multiple Choice)
4.8/5
(33)

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)

An applet using a Swing GUI extends which class?

(Multiple Choice)
4.8/5
(41)

Applets are important because the can be used to:

(Multiple Choice)
4.8/5
(32)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)