Solved

What Will Be the Result When the Following Code Is

Question 8

Multiple Choice

What will be the result 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 image will resize itself to fit the label.
B) The image will resize itself to fit the panel.
C) The panel will resize itself to accommodate the image.
D) The JFrame that encloses the window will resize itself to accommodate the image.

Correct Answer:

verifed

Verified

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

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents