@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == record)
		{
			selectedInstance = new RecorderPanel(this, new GridLayout(4,2));
			System.out.println("buttonClicked!");
		}
		else if(e.getSource() == play)
		{
			selectedInstance = new PlayPanel(this, new FlowLayout());
		}
		else if(e.getSource() == generateAccompaniment)
		{
			selectedInstance = new AccompanimentPanel(this, new FlowLayout());
		}
		else if(e.getSource() == getSampleMelody)
		{
			selectedInstance = new SamplePanel(this, new GridLayout(4,2));
		}
		
		topLevel.add(selectedInstance);
		selectedInstance.setVisible(true);
		this.setVisible(false);
	}