scusa andbin non ho ben chiaro quello che mi hai spiegato all'ultimo messaggio.mi spiego meglio:
prendiamo il tuo esempio che hai incollato qui. il tuo era con 2 righe ed io lo voglio far diventare di 3 righe. in Particolare io alla riga 3 non voglio piu che si ha uno spaceAbove di 30
quindi lo space above dovrebbe essere solo tra la riga 1 e la riga 2...mentre tra la 2 e la 3 no... Ho provato a modificare il tuo codice ma non mi esce...mi esco o tutti attaccati o tutti con lo space above. mi potresti fare un esampio.grazie della tua buona volonta.
codice:
attributes = new SimpleAttributeSet();
StyleConstants.setItalic(attributes, true);
document.insertString(document.getLength(), "Riga uno\n", attributes);
attributes = new SimpleAttributeSet();
StyleConstants.setSpaceAbove(attributes, 30);
document.setParagraphAttributes(document.getLength(), 0, attributes, false);
attributes = new SimpleAttributeSet();
StyleConstants.setForeground(attributes, Color.RED);
document.insertString(document.getLength(), "Riga due", attributes);
document.setParagraphAttributes(document.getLength(), 0, attributes, false);
attributes = new SimpleAttributeSet();
StyleConstants.setForeground(attributes, Color.RED);
document.insertString(document.getLength(), "\nRiga tre", attributes);