le code suivant marche
styledefaut = new SimpleAttributeSet();
StyleConstants.setFontFamily(styledefaut, "Verdana");
StyleConstants.setBold(styledefaut, true);
StyleConstants.setFontSize(styledefaut, 16);
StyleConstants.setAlignment(styledefaut, StyleConstants.ALIGN_LEFT);
StyleConstants.setSpaceAbove(styledefaut, 13.0F);
StyleConstants.setLeftIndent(styledefaut, 7.0F);
StyleConstants.setSpaceBelow(styledefaut, 20.0F);
StyleConstants.setRightIndent(styledefaut, 7.0F);
StyleConstants.setLineSpacing(styledefaut, -0.7F);
document = new DefaultStyledDocument();
zonetexte.setStyledDocument(document);
composanttexte = new SimpleAttributeSet(styledefaut);
le composant cree dans le jtextpane
SimpleAttributeSet composant;
DefaultStyledDocument document;
StyleConstants.setComponent(composant, bouton);
try {
position = document.getLength();
document.insertString(position, "\n", composant);
document.setParagraphAttributes(position, len, styledefaut, false);
}
catch (BadLocationException ex) { }
suppresion du composant
document.remove(position, 1);
Donc pb regle merci du renseignement