ragazzi ho il seguente problema:
sto incollando delle stringhe di testo in una JTP e noto che i metodo per esempio setBold oppure setItalic risco correttamente ad usarli nel senso che vedo il risultato, invece quando uso per esempio
setSpaceBelow
setLeftIndent
setFirstLineIndent
setRightIndent.........non vedo alcun risultato. come mai?? io vorrei realizzare un effetto tipo:
visualizza la stringa "A" visualizzo la stringa "B" pero B rispetto ad A e spostato di un tot.poi per esempio vorrei lasciare spazio tra un titolo e altre stringhe sotto...penso che i metodo sono quelli corretti non ho capito perche non vanno come gli altri. il codice che ho scritto comunque è il seguente:
codice:
SimpleAttributeSet attributes;
document = new DefaultStyledDocument ();
areaDiTesto = new JTextPane (document);
JScrollPane scrollPane = new JScrollPane (areaDiTesto);
areaDiTesto.setEditable(false);
attributes = new SimpleAttributeSet ();
StyleConstants.setItalic(attributes,true);
StyleConstants.setBold(attributes,true);
StyleConstants.setFontSize(attributes,14);
StyleConstants.setRightIndent(attributes,15000);
StyleConstants.setLineSpacing(attributes,1222);
document.insertString(document.getLength (),"PROGETTAZIONE",attributes);
ecco come ho fatto...cosa sbaglio?grazie a tutti