void setAttributes(AttributeSet a) {

		attributes = new SimpleAttributeSet();

		/***************************************************************************************************************
		 * IMPORTANT: remove component and icon attributes from the MutableAttributeSet. * This does not affect this
		 * function of dialog box, because it changes only the textual * attributes of the selected text. In particle,
		 * the strange $ename attribute must be remove as well. *
		 **************************************************************************************************************/

		java.util.Enumeration e = a.getAttributeNames();
		Object name, attr;
		while (e.hasMoreElements()) {
			name = e.nextElement();
			attr = a.getAttribute(name);
			if (!name.toString().equals(StyleConstants.ComponentElementName.toString())
					&& !name.toString().equals(StyleConstants.IconElementName.toString())
					&& !name.toString().equals("$ename")) {
				attributes.addAttribute(name, attr);
			}
		}

		String fontName = StyleConstants.getFontFamily(a);
		lstFontName.setSelected(fontName);
		int size = StyleConstants.getFontSize(a);
		lstFontSize.setSelectedInt(size);
		checkBoxBold.setSelected(StyleConstants.isBold(a));
		checkBoxItalic.setSelected(StyleConstants.isItalic(a));
		checkBoxUnderline.setSelected(StyleConstants.isUnderline(a));
		checkBoxStrikethrough.setSelected(StyleConstants.isStrikeThrough(a));
		checkBoxSubscript.setSelected(StyleConstants.isSubscript(a));
		checkBoxSuperscript.setSelected(StyleConstants.isSuperscript(a));

		Color foreground = StyleConstants.getForeground(a);
		int k = ColorRectangle.COLORS.length, i;
		for (i = 0; i < ColorRectangle.COLORS.length; i++) {
			if (foreground.equals(ColorRectangle.COLORS[i]))
				k = i;
		}
		if (k == ColorRectangle.COLORS.length) {
			((ColorRectangle) cbColor.getRenderer()).setMoreColor(foreground);
		}
		cbColor.removeActionListener(fontColorAction);
		cbColor.setSelectedIndex(k);
		cbColor.addActionListener(fontColorAction);

		updatePreview();

	}