What will display when the following code is executed?

```
imagePanel = new JPanel();
imageLabel = new JLabel();
imagePanel.Add(imageLabel);
ImageIcon sunnyFaceImage =
new ImageIcon("SunnyFace.gif");
imageLabel.setIcon(sunnyFaceImage);
pack();

```

A) The JFrame that encloses the window will resize itself to accommodate the SunnyFace image.
B) imagePanel will resize itself to accommodate the SunnyFace image.
C) The SunnyFace image will resize itself to fit on imageLabel.
D) The SunnyFace image will resize itself to fit on imagePanel.


A) The JFrame that encloses the window will resize itself to accommodate the SunnyFace image.

Computer Science & Information Technology

You might also like to view...

Case-based Critical Thinking QuestionsCase 11-1Ryan is new to the use of XML, so he has a lot of basic questions about the fundamentals, including some philosophical questions about the language. Ryan has heard that an XML document must be well-formed. Which of the following is NOT a characteristic of a well-formed document?

A. It contains no syntax errors. B. It has a prolog, body, and epilog. C. It includes an XML declaration. D. It satisfies the rules of its DTD or schema.

Computer Science & Information Technology

The code in the accompanying figure contains selectors for ____.

A. links that have not been visited B. links that have been clicked C. active links D. both a and b

Computer Science & Information Technology

The separate variables for each record are called ____.

A. data B. fields C. filters D. files

Computer Science & Information Technology

Located at the bottom of the screen, the ____________________ displays the vertical page position.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology