private void setUp(Image im, String t) {
        setTitle(t);

  		// Build box buttonBox of buttons.
  		
  		// First compute largest button size.
  		int msize = 0;
		for (int i=0; i < buttonLabelList.length; i= i+1) {
			if (msize < buttonLabelList[i].length()) {
				msize = buttonLabelList[i].length();
			}
		}  		
        
        /* inv: buttonList[0..i-1] contain JButtons with labels
         * buttonLabelList[0..i-1], each JButton has been added to buttonBox,
         *  and this ImageGUI is registered as a listener to these JButtons
         */
		Dimension size = new Dimension(140,buttonList.length*31);
		buttonBox.setPreferredSize(size);
		buttonBox.setSize(size);
		for (int i=0; i < buttonLabelList.length; i= i+1) {
            buttonList[i]= new JButton(buttonLabelList[i]);
            buttonBox.add(buttonList[i]);
		}
        getContentPane().add(BorderLayout.WEST, buttonBox);
        
        // Build box inputBox of the color buttons.
        checkboxBox.add(greyButton);
        checkboxBox.add(sepiaButton);
        inputBox.add(checkboxBox);
        
        // Add the color buttons to group.
        group.add(greyButton);
        group.add(sepiaButton);
        
        getContentPane().add(BorderLayout.NORTH, inputBox);
        
        // Add a text area with label
  		areaBox.add(jlabel);
 	    areaBox.add(scrollPane);
  	    getContentPane().add(BorderLayout.SOUTH, areaBox);
        
        // If there is no image, make JFrame invisible and return
        if (im == null) {
            setVisible(false);
            return;
        }
        
        // Create the two panels and the ImageProcessor processor.
        originalPanel= new ImagePanel(im);
        currentPanel= new ImagePanel(im);
        
        // Add the panels to the GUI, in imagebox.
        imagebox= new Box(BoxLayout.X_AXIS);
        imagebox.add(originalPanel);
        imagebox.add(currentPanel);
        getContentPane().add(BorderLayout.CENTER, imagebox);
        
        // Place and resize the window
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setLocation(200,100);
        pack();
        setVisible(true);
        repaint();
    }