private void setFrame() {
		getContentPane().setLayout(new GridBagLayout());
		getContentPane().setBackground(panelcolour);
		setTitle("Preferences");
		fontPanel = new JPanel();
		ButtonGroup bg = new ButtonGroup();
		small = new JRadioButton("Small");
		small.setFont(frame.FONT_SMALL);
		small.setFocusable(true);
		small.getAccessibleContext().setAccessibleDescription("Font size of 12");
		small.addKeyListener(new KeyListener() {

			@Override
			public void keyTyped(KeyEvent arg0) {
				// TODO Auto-generated method stub

			}

			@Override
			public void keyReleased(KeyEvent arg0) {
				// TODO Auto-generated method stub

			}

			@Override
			public void keyPressed(KeyEvent arg0) {
				// TODO Auto-generated method stub
				if(small.isFocusOwner()&& arg0.getKeyCode()== KeyEvent.VK_ENTER){
					small.setSelected(true);	
					sampleText.setFont(frame.FONT_SMALL);
					newFont = frame.FONT_SMALL;
					updateFont(newFont);

				}

			}
		});

		small.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				// TODO Auto-generated method stub
				sampleText.setFont(frame.FONT_SMALL);
				newFont = frame.FONT_SMALL;
				updateFont(newFont);

			}
		});
		medium = new JRadioButton("Medium");
		medium.setSelected(true);
		medium.setFont(frame.FONT_MEDIUM);
		medium.setFocusable(true);
		medium.getAccessibleContext().setAccessibleDescription("Font size of 16");
		medium.addKeyListener(new KeyListener() {

			@Override
			public void keyTyped(KeyEvent arg0) {
				// TODO Auto-generated method stub

			}

			@Override
			public void keyReleased(KeyEvent arg0) {
				// TODO Auto-generated method stub

			}

			@Override
			public void keyPressed(KeyEvent arg0) {
				// TODO Auto-generated method stub
				if(medium.isFocusOwner()&& arg0.getKeyCode()== KeyEvent.VK_ENTER){
					medium.setSelected(true);	
					sampleText.setFont(frame.FONT_MEDIUM);
					newFont = frame.FONT_MEDIUM;
					updateFont(newFont);

				}

			}
		});
		medium.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				// TODO Auto-generated method stub
				sampleText.setFont(frame.FONT_MEDIUM);
				newFont = frame.FONT_MEDIUM;
				updateFont(newFont);
			}
		});
		large = new JRadioButton("Large");
		large.setFont(frame.FONT_LARGE);
		large.setFocusable(true);
		large.getAccessibleContext().setAccessibleDescription("Font size of 24");
		large.addKeyListener(new KeyListener() {

			@Override
			public void keyTyped(KeyEvent arg0) {
				// TODO Auto-generated method stub

			}

			@Override
			public void keyReleased(KeyEvent arg0) {
				// TODO Auto-generated method stub

			}

			@Override
			public void keyPressed(KeyEvent arg0) {
				// TODO Auto-generated method stub
				if(large.isFocusOwner()&& arg0.getKeyCode()== KeyEvent.VK_ENTER){
					large.setSelected(true);	
					sampleText.setFont(frame.FONT_LARGE);
					newFont = frame.FONT_LARGE;
					updateFont(newFont);

				}

			}
		});
		large.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				// TODO Auto-generated method stub
				sampleText.setFont(frame.FONT_LARGE);
				newFont = frame.FONT_LARGE;
				updateFont(newFont);
			}
		});
		bg.add(small);
		bg.add(medium);
		bg.add(large);
		fontPanel.setBackground(frame.ORANGE_THEME[0]);		
		fontPanel.add(small);
		fontPanel.add(medium);
		fontPanel.add(large);

		fontPreview = new JPanel(new GridBagLayout());
		fontPreview.setBackground(panelcolour);
		sampleText = new JLabel("The Text looks like this");
		sampleText.setFont(frame.FONT_MEDIUM);
		GridBagConstraints gbc_fontPanel = new GridBagConstraints();
		gbc_fontPanel.fill = GridBagConstraints.BOTH;
		gbc_fontPanel.gridx = 0;
		gbc_fontPanel.gridy = 0;
		gbc_fontPanel.weightx = 1;
		gbc_fontPanel.weighty = 0;
		fontPreview.add(fontPanel, gbc_fontPanel);

		GridBagConstraints gbc_fontlabel = new GridBagConstraints();
		gbc_fontlabel.fill = GridBagConstraints.RELATIVE;
		gbc_fontlabel.gridx = 0;
		gbc_fontlabel.gridy = 1;
		gbc_fontlabel.weightx = 1;
		gbc_fontlabel.weighty = 0;
		fontPreview.add(sampleText, gbc_fontlabel);
		border = new LineBorder(frame.ORANGE_THEME[0], 3, true);
		fontPreview.setBorder(BorderFactory.createCompoundBorder(new EmptyBorder(10, 10, 10, 10), BorderFactory.createCompoundBorder(new TitledBorder(null, "Font", TitledBorder.LEADING, TitledBorder.TOP, null, null), new EmptyBorder(5, 5, 5, 5))));
		colourName = new JComboBox(new String[] { "Green", "Orange", "Blue","Default" });
		colourName.setFont(newFont);
		colourName.setSelectedIndex(1);
		colourName.setFocusable(true);
		colourName.getAccessibleContext().setAccessibleDescription("You can select different colour themes for the application");
		colourName.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {
				updateColour();
			}
		});
		colourPreview = new JPanel(new BorderLayout());
		inputarea = new JTextArea();
		inputarea.setBackground(frame.ORANGE_THEME[2]);
		inputarea.setEditable(false);
		colourPreview.add(colourName, BorderLayout.NORTH);
		colourPreview.add(inputarea, BorderLayout.CENTER);
		colourPreview.setOpaque(false);
		colourPreview.setBorder(BorderFactory.createCompoundBorder(new EmptyBorder(10, 10, 10, 10), BorderFactory.createCompoundBorder(new TitledBorder(null, "Colour", TitledBorder.LEADING, TitledBorder.TOP, null, null), new EmptyBorder(5, 5, 5, 5))));
		GridBagConstraints gbc_font = new GridBagConstraints();
		gbc_font.fill = GridBagConstraints.BOTH;
		gbc_font.gridx = 0;
		gbc_font.gridy = 0;
		gbc_font.weightx = 1;
		gbc_font.weighty = 0.2;
		getContentPane().add(fontPreview, gbc_font);
		

		GridBagConstraints gbc_colour = new GridBagConstraints();
		gbc_colour.fill = GridBagConstraints.BOTH;
		gbc_colour.gridx = 0;
		gbc_colour.gridy = 1;
		gbc_colour.weightx = 0;
		gbc_colour.weighty = 0.3;
		getContentPane().add(colourPreview, gbc_colour);

		JButton okButton = new JButton("Ok");
		okButton.setFocusable(true);
		okButton.getAccessibleContext().setAccessibleDescription("Updates the application with the selected font and colour");
		okButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {
				saveandclose();
			}
		});
		JButton cancelButton = new JButton("Cancel");
		cancelButton.setFocusable(true);
		cancelButton.getAccessibleContext().setAccessibleDescription("Cancel the preferences and go back the main application");
		cancelButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {
				cancelandclose();
			}
		});

		controlPanel = new JPanel();
		controlPanel.add(okButton);
		controlPanel.add(cancelButton);
		controlPanel.setBackground(panelcolour);
		GridBagConstraints gbc_buttons = new GridBagConstraints();
		gbc_buttons.fill = GridBagConstraints.REMAINDER;
		gbc_buttons.gridx = 0;
		gbc_buttons.gridy = 2;
		gbc_buttons.weightx = 1;
		gbc_buttons.weighty = 0;
		getContentPane().add(controlPanel, gbc_buttons);

	}