Solved

What Will Display When the Following Code Is Executed

Question 39

Multiple Choice

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.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions