public ProfileEditorDialog(LaunchFrame instance, final String editingName, boolean modal) {
		super(instance, modal);

		setupGui();

		getRootPane().setDefaultButton(update);

		username.setText(UserManager.getUsername(editingName));
		name.setText(editingName);

		if(UserManager.getPassword(editingName).isEmpty()){
			password.setEnabled(false);
			savePassword.setSelected(false);
		} else {
			password.setText(UserManager.getPassword(editingName));
			savePassword.setSelected(true);
		}

		username.getDocument().addDocumentListener(new DocumentListener() {
			@Override
			public void removeUpdate(DocumentEvent arg0) {
				name.setText(username.getText());
			}

			@Override
			public void insertUpdate(DocumentEvent arg0) {
				name.setText(username.getText());
			}
			@Override public void changedUpdate(DocumentEvent e) { }
		});

		savePassword.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent event) {
				password.setEnabled(savePassword.isSelected());
			}
		});

		update.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				if(editingName.equals(name.getText()) || (!UserManager.getUsernames().contains(username.getText()) && !UserManager.getNames().contains(name.getText()))) {
					if(savePassword.isSelected()) {
						if(password.getPassword().length > 1) {
							UserManager.updateUser(editingName, username.getText(), new String(password.getPassword()), name.getText());
						}
					} else {
						UserManager.updateUser(editingName, username.getText(), "", name.getText());
					}
					LaunchFrame.writeUsers(name.getText());
					setVisible(false);
				}
			}
		});

		remove.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				UserManager.removeUser(editingName);
				LaunchFrame.writeUsers(null);
				setVisible(false);
			}
		});
	}