protected JPanel setupNametablePanel() {
		JPanel panel = new JPanel();
		panel.setLayout(new FlowLayout(FlowLayout.LEFT));
		panel.setBorder(new TitledBorder("Nametable"));
		{
			final JSpinner spinner = new JSpinner();
			Integer value = new Integer(numTilesWide);
			Integer min = new Integer(1);
			Integer max = new Integer(getMaxTilesWide());
			Integer step = new Integer(1);
			SpinnerNumberModel spinnerModel = new SpinnerNumberModel(value, min, max, step);
			spinner.setModel(spinnerModel);
			spinner.setToolTipText("Number of tiles Wide to convert the image into the CHR");
			spinner.addChangeListener(new ChangeListener() {

				public void stateChanged(ChangeEvent e) {
					int newVal = ((Integer) spinner.getModel().getValue()).intValue();
					if (newVal != numTilesWide) {
						setNumTilesWide(newVal);
					}
				}
			});
			panel.add(new JLabel("Num Tiles Wide:"));
			panel.add(spinner);
		}

		{
			final JSpinner spinner = new JSpinner();
			Integer value = new Integer(numTilesHigh);
			Integer min = new Integer(1);
			Integer max = new Integer(getMaxTilesHigh());
			Integer step = new Integer(1);
			SpinnerNumberModel spinnerModel = new SpinnerNumberModel(value, min, max, step);
			spinner.setModel(spinnerModel);
			spinner.setToolTipText("Number of tiles High to convert the image into the CHR");
			spinner.addChangeListener(new ChangeListener() {

				public void stateChanged(ChangeEvent e) {
					int newVal = ((Integer) spinner.getModel().getValue()).intValue();
					if (newVal != numTilesHigh) {
						setNumTilesHigh(newVal);
					}
				}
			});
			panel.add(new JLabel("Num Tiles High:"));
			panel.add(spinner);
		}
		{
			final JSpinner spinner = new JSpinner();
			Integer value = new Integer(_tileStartOffset);
			Integer min = new Integer(0);
			Integer max = new Integer(255);
			Integer step = new Integer(1);
			if(value < min){
				value = min;
			}
			if(value > max) {
				value = max;	
			}
			SpinnerNumberModel spinnerModel = new SpinnerNumberModel(value, min, max, step);
			spinner.setModel(spinnerModel);
			spinner.setToolTipText("Offset for the CHR tiles");
			spinner.addChangeListener(new ChangeListener() {

				public void stateChanged(ChangeEvent e) {
					int newVal = ((Integer) spinner.getModel().getValue()).intValue();
					if (newVal != numTilesHigh) {
						setCHRTilesOffset(newVal);
					}                    
				}
			});
			panel.add(new JLabel("Tile Offset:"));
			panel.add(spinner);
		}
		{
			final JSpinner spinner = new JSpinner();
			Integer value = new Integer(_scaleFactor);
			Integer min = new Integer(1);
			Integer max = new Integer(16);
			Integer step = new Integer(1);
			SpinnerNumberModel spinnerModel = new SpinnerNumberModel(value, min, max, step);
			spinner.setModel(spinnerModel);
			spinner.setToolTipText("Scale the Image to make it easier to see the details");
			spinner.addChangeListener(new ChangeListener() {

				public void stateChanged(ChangeEvent e) {
					int newVal = ((Integer) spinner.getModel().getValue()).intValue();
					if (newVal != _scaleFactor) {
						setScaleFactor(newVal);
					}
				}
			});
			panel.add(new JLabel("Scale:"));
			panel.add(spinner);
		}
		{
			final JSpinner spinner = new JSpinner();
			Integer value = new Integer(0);
			Integer min = new Integer(0);
			Integer max = new Integer(99);
			Integer step = new Integer(1);
			SpinnerNumberModel spinnerModel = new SpinnerNumberModel(value, min, max, step);
			spinner.setModel(spinnerModel);
			spinner.setToolTipText("Margin of Error for tile comparison. Smaller is more accurate");
			spinner.addChangeListener(new ChangeListener() {

				public void stateChanged(ChangeEvent e) {
					int newVal = ((Integer) spinner.getModel().getValue()).intValue();
					CHRTile.IMAGE_SIMILARITY_THRESHOLD = newVal;
					guessPalette();
				}
			});
			panel.add(new JLabel("Margin of Error:"));
			panel.add(spinner);
		}        


		return panel;
	}