Assignment #8 Picture Frame II



The design and layout of assignment 7 was bad, we can do better. And we will. In this assignment.

Change assignment 7 to a GUI showing this layout:

Mainly 2 things have changed:

  1. The images are scaled
  2. The layout is different
Of course the original functionality (press the button, see the image) is maintained.

Here's a class that scales an ImageIcon, the class 'IconUtility'. It contains only one static method, named
'createSizedIcon(ImageIcon icon, int width, int height)'.
It takes an ImageIcon as input, together with width/height of the returned version, being a new ImageIcon (the old icon is NOT changed).
Here comes the class.

Usage example: let icon1 be an ImageIcon. Then
ImageIcon icon1scaled = IconUtility.createSizedIcon(icon1,20,30);
creates a new icon 'icon1scaled', size 20x30.

The layout is not a basic layout, it's a nested layout. Think, and you'll find out.
The size of the small ImageIcons in the picture above is 64x48, the original picture being 320x240


2 BONUS POINTS for creativity: if you create a better GUI: 2 Bonus points !