preview.remoteRepaint();
preview.repaint();
	protected void init()	{				String[] palNames = new String[NUM_PALETTES];		for (int i = 0; i < NUM_PALETTES; i++)			palNames[i] = "Palette #" + i;				mainWindow = createBaseWindow(this);		mainWindow.setTitle(this.getDescription());				JPanel topPanel = new JPanel(new FlowLayout());		topPanel.add(new JLabel("Entry: "));		String[] entryNames = new String[NUM_PHOTOS];		for (int i = 0; i < entryNames.length; i++)			entryNames[i] = "Entry #" + i;		entryChooser = new JComboBox(entryNames);		entryChooser.addActionListener(this);		topPanel.add(entryChooser);		mainWindow.getContentPane().add(				topPanel, BorderLayout.NORTH);				JPanel panel = new JPanel(new FlowLayout());				JPanel tmpPanel = new JPanel();		tmpPanel.setLayout(				new BoxLayout(tmpPanel, BoxLayout.Y_AXIS));				JPanel tmpPanel2 = new JPanel();		tmpPanel2.setLayout(				new BoxLayout(tmpPanel2, BoxLayout.Y_AXIS));		for (int i = 0; i < party.length; i++)		{			for (int j = 0; j < party[i].length; j++)			{				String description;				if (j == 0)				{					description = "Enable Party Member #" + (i + 1);					JCheckBox cbox = new JCheckBox();					cbox.addActionListener(this);					party[i][j] = cbox;				}				else				{					if (j == 1)						description = "X: ";					else						description = "Y: ";					JTextField text =						HackModule.createSizedJTextField(4, true);					text.getDocument().addDocumentListener(this);					party[i][j] = text;				}				tmpPanel2.add(						HackModule.getLabeledComponent(								description, party[i][j]));			}		}				JPanel tmpPanel3 = new JPanel();		tmpPanel3.setLayout(				new BoxLayout(tmpPanel3, BoxLayout.Y_AXIS));		SpriteEditor.initSptNames(rom.getPath());		for (int i = 0; i < extra.length; i++)		{			for (int j = 0; j < extra[i].length; j++)			{				String description;				if (j == 0)				{					JCheckBox cbox = new JCheckBox();					cbox.addActionListener(this);					extra[i][j] = cbox;					description = "Enable Extra Sprite #" + (i + 1);				}				else if (j == 1)				{					JComboBox cbox = new JComboBox(sptNames);					cbox.addActionListener(this);					extra[i][j] = cbox;					description = "Sprite: ";				}				else				{					if (j == 2)						description = "X: ";					else						description = "Y: ";					JTextField text =						HackModule.createSizedJTextField(4, true);					text.getDocument().addDocumentListener(this);					extra[i][j] = text;				}				tmpPanel3.add(						HackModule.getLabeledComponent(								description, extra[i][j]));			}		}				photoPaletteChooser = new JComboBox(palNames);		landX = HackModule.createSizedJTextField(4, true);		landY = HackModule.createSizedJTextField(4, true);				preview = new PhotoPreview(this, party, extra, photoPaletteChooser,				landX, landY);		preview.addMouseListener(preview);		preview.addMouseMotionListener(preview);		preview.setPreferredSize(				new Dimension(						preview.getPreviewWidth() 							* MapEditor.tileWidth + 2,						preview.getPreviewHeight() 							* MapEditor.tileHeight + 2));				tmpPanel.add(HackModule.pairComponents(				HackModule.pairComponents(sp,subPaletteChooser,false)				,preview,true));		flag = HackModule.createSizedJTextField(5, false);		tmpPanel.add(				HackModule.getLabeledComponent(						"Event Flag: ", flag));		DocumentListener centerListener =			new DocumentListener()			{				public void changedUpdate(DocumentEvent e)				{					if ((centerX.getText().length() > 0)							&& (centerY.getText().length() > 0))					{						preview.setXY(								Integer.parseInt(centerX.getText()),								Integer.parseInt(centerY.getText()));						preview.remoteRepaint();					}				}								public void insertUpdate(DocumentEvent e)				{					changedUpdate(e);				}				public void removeUpdate(DocumentEvent e)				{					changedUpdate(e);				}			};		refresh = new JButton("Refresh");		refresh.addActionListener(this);		tmpPanel.add(refresh);		centerSeek = new JButton("Find on Map");		centerSeek.addActionListener(this);		tmpPanel.add(				HackModule.getLabeledComponent(						"Center of Picture: ", centerSeek));		centerX = HackModule.createSizedJTextField(4, true);		centerX.getDocument().addDocumentListener(centerListener);		tmpPanel.add(				HackModule.getLabeledComponent(						"Center of Picture (X): ", centerX));		centerY = HackModule.createSizedJTextField(4, true);		centerY.getDocument().addDocumentListener(centerListener);		tmpPanel.add(				HackModule.getLabeledComponent(						"Center of Picture (Y): ", centerY));		photoPaletteChooser.addActionListener(this);		tmpPanel.add(				HackModule.getLabeledComponent(						"Palette: ", photoPaletteChooser));		direction = new JComboBox(				new String[] {						"Down", "45 Degree Down and Left",						"Left", "45 Degree Up and Left",						"Up", "45 Degree Up and Right",						"Right", "45 Degree Down and Right"				});		tmpPanel.add(				HackModule.getLabeledComponent(						"Photo Movement: ", direction));		distance = HackModule.createSizedJTextField(3, true);		tmpPanel.add(				HackModule.getLabeledComponent(						"Photo Movement Distance: ", distance));		landX.getDocument().addDocumentListener(this);		tmpPanel.add(				HackModule.getLabeledComponent(						"Photoman Landing Location (X): ", landX));		landY.getDocument().addDocumentListener(this);		tmpPanel.add(				HackModule.getLabeledComponent(						"Photoman Landing Location (Y): ", landY));		tmpPanel.setAlignmentY(Component.TOP_ALIGNMENT);		panel.add(tmpPanel);				sp = new SpritePalette();		sp.addActionListener(this);		String[] subpalNames = new String[6];		for (int i = 0; i < subpalNames.length; i++)			subpalNames[i] = "Subpalette " + i;		subPaletteChooser = new JComboBox(subpalNames);		subPaletteChooser.addActionListener(this);		JPanel palPanel = new JPanel();		palPanel.add(new JLabel("Palette Editing"));		palPanel.add(subPaletteChooser);		palPanel.add(sp);				panel.add(				HackModule.pairComponents(						HackModule.pairComponents(tmpPanel2, tmpPanel3, true),						palPanel, false));				mainWindow.getContentPane().add(panel, BorderLayout.CENTER);		mainWindow.pack();	}