Keyword indicates the inheritance relationship A extends B

Keyword ________ indicates the inheritance relationship.

A) extends
B) inherits
C) super
D) parent

Method drawOval’s arguments specify ________.

A) the upper-left and upper-right corners of the oval
B) the upper-left corner, scale and size of the oval
C) the position and size of the bounding rectangle for the oval
D) the position and size of the bounding cycle for the oval

Java uses class ________ to represent colors using their RGB values.

A) Color
B) Colors
C) RGBColor
D) RGBColors

Filled rectangles and filled circles are drawn using Graphics method ________ and ________.

A) fillRect, fillCircle.
B) filledRect, filledCircle
C) fillRect, fillOval
D) filledRect, filledOval.

Which of the following statements about an arc is false?

A) An arc is a section of an oval.
B) The sweep is the amount of arc to cover.
C) Method drawArc draws the edges of an arc.
D) The fillArc method draws an oval, with the section that is an arc filled in.

Which method changes the text the label displays?

A) changeText
B) setText
C) changeLabel
D) setLabel

Which component contains menus?

A) Menu button
B) Title bar
C) Menu bar
D) Combo box

The text “Hello there, my friend.” is an example of what type of capitalization?

A) sentence-style capitalization
B) book-title capitalization
C) Neither of the above
D) Both of the above

The JOptionPane constant used to display an icon prompting the user for input is:

A) JOptionPane.ERROR_MESSAGE
B) JOptionPane.INFORMATION_MESSAGE
C) JOptionPane.QUESTION_MESSAGE
D) JOptionPane.WARNING_MESSAGE

Which of the following statements for a JTextField is false?

A) Can be used to display uneditable text.
B) Can be used to display editable text.
C) Enables users to enter data from the keyboard.
D) Displays a list of fields.

Which of the following statements about Swing GUI components is false?

A) Swing components are less portable but more flexible than the original Java GUI components from package java.awt.
B) Most Swing components are written completely in Java.
C) Swing components allow the user to specify a uniform look-and-feel across all platforms.
D) Swing components allow the user to change the look-and-feel while the program is running.

Which of the following statements about heavyweight components is false?

A) AWT components are not heavyweight components.
B) Several Swing components are heavyweight components.
C) The look-and-feel may vary across platforms.
D) The functionality may vary across platforms.

Which pair of words does not complete the sentence below correctly?
A ________ is a ________.

A) Container, Component
B) Container, JPanel
C) JComponent, Container
D) Component, Object

Some common lightweight component features supported by JComponent include:

A) support for user-interface localization
B) shortcut keys
C) tool tips
D) All of the above

_________ provides the basic attributes and behaviors of a window—a title bar at the top of the window, and buttons to minimize, maximize and close the window.

A) JLabel
B) JFrame
C) JSwing
D) JWindowControl

Which of the following statements about a JLabel is false?

A) Applications rarely change a label’s contents after creating it.
B) A JLabel can display text and an image.
C) A JLabel can display text and a button.
D) A JLabel is a subclass of JComponent.

Solution

1)

The keyword “extends” indicates the inheritance relationship in java. The keyword “extends” means; the current class is a sub class of the already existing class.

Answer:

A) Extends

2)

The drawOval() method is used to draw a circle or an ellipse.

The syntax for drawOval() method is show below:

drawOval(int xLeft, int yTop, int width, int height);

Answer:

D) The position and size of the bounding cycle for the oval.

3)

The “Color” class is used to define the RGB colors. The class is present in java.awt.Color package.

The Sample class is given below:

new Color(r, g, b).getRGB()

Answer:

A) color

4)

The “fillRect()” method is used to draw a rectangle with a preciously set color.

Example:

            fillRect(35, 45, 75, 95);

The fillOval() method is used to draw a circle with a preciously set color.

Example:

            fillOval(270, 130, 50, 50);

Answer:

C) fillRect, fillOval

5)

Answer:

A) An arc is a section of an oval.

6)

The setText() method is used to change the text of the label.

Example:

lblName.setText(\"SampleText\");

Answer:

A) setText()

7)

The “Menu bar” component contains the menus.

Answer: Menu bar

8)

In sentence style capitalization, the first word of the tile and the proper names are capitalized.

Answer:

A) sentence-style capitalization

9)

Answer:

C) JOptionPane.QUESTION_MESSAGE

10)

Answer:

D) Displays a list of fields.

11)

Answer:

A) Swing components are less portable but more flexible than the original Java GUI components from package java.awt.

12)

A heavyweight component is associated with its own native screen resource (commonly known as a peer). Components from the java.awt package, such as Button and Label, are heavyweight components.

Answer:

A) AWT components are not heavyweight components.

13)

Answer:

D) Container/JPanel.

14)

Some common lightweight component features supported by JComponent include:

pluggable look-and-feel

Shortcut keys (called mnemonics)

Common event-handling capabilities for components that initiate the same actions in an application.

tool tips

Support for accessibility

Support for user-interface localization

Answer:

D) All of the above

15)

Answer:

D) JWindowControl

16)

JLabel cannot display an image.

Answer:

B) A JLabel can display text and an image.

           

Keyword ________ indicates the inheritance relationship. A) extends B) inherits C) super D) parent Method drawOval’s arguments specify ________. A) the upper-le
Keyword ________ indicates the inheritance relationship. A) extends B) inherits C) super D) parent Method drawOval’s arguments specify ________. A) the upper-le
Keyword ________ indicates the inheritance relationship. A) extends B) inherits C) super D) parent Method drawOval’s arguments specify ________. A) the upper-le
Keyword ________ indicates the inheritance relationship. A) extends B) inherits C) super D) parent Method drawOval’s arguments specify ________. A) the upper-le
Keyword ________ indicates the inheritance relationship. A) extends B) inherits C) super D) parent Method drawOval’s arguments specify ________. A) the upper-le

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site