Centrer tekst i StyledDocument
hejsajeg har lavet et StyledDocument hvori jeg gerne vil centrer teksten.
Style fontStyle = doc.addStyle("ændre font str osv", null);
StyleConstants.setAlignment(fontStyle,StyleConstants.ALIGN_CENTER);
StyleConstants.setFontSize(fontStyle,12);
StyleConstants.setBold(fontStyle,true);
doc.insertString(doc.getLength(),"teksten der skal centreres",fontStyle);
