Biology Forums - Study Force

Science-Related Homework Help Computer Studies Topic started by: Eels on Dec 16, 2016



Title: What will display when the following code is executed?imagePanel = new JPanel();imageLabel = new ...
Post by: Eels on Dec 16, 2016
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 SunnyFace image will resize itself to fit on imageLabel.
B) The SunnyFace image will resize itself to fit on imagePanel.
C) The JFrame that encloses the window will resize itself to accommodate the SunnyFace image.
D) imagePanel will resize itself to accommodate the SunnyFace image.


Title: Re: What will display when the following code is executed?imagePanel = new JPanel();imageLabel = new ...
Post by: Toothy on Dec 18, 2016
Content hidden


Title: Re: What will display when the following code is executed?imagePanel = new JPanel();imageLabel = new ...
Post by: Eels on Jan 31, 2017
I was nearly about to give up, thanks


Title: Re: What will display when the following code is executed?imagePanel = new JPanel();imageLabel = new ...
Post by: Toothy on Mar 16, 2017
Thanks for providing feedback