void setStateOfToggleButton(JToggleButton toggle, boolean b, boolean noText) {

		Action a = toggle.getAction();
		ActionListener[] al = toggle.getActionListeners();
		ItemListener[] il = toggle.getItemListeners();
		String s = toggle.getText();

		toggle.setAction(null);
		if (al != null) {
			for (ActionListener x : al)
				toggle.removeActionListener(x);
		}
		if (il != null) {
			for (ItemListener x : il)
				toggle.removeItemListener(x);
		}

		toggle.setSelected(b);

		toggle.setAction(a);
		if (al != null) {
			for (ActionListener x : al)
				toggle.addActionListener(x);
		}
		if (il != null) {
			for (ItemListener x : il)
				toggle.addItemListener(x);
		}

		if (noText)
			toggle.setText(null);
		else toggle.setText(s);

	}