Any reason for bold and italic not nesting with StyleConstants?
I have this code:
privatevoid setBoldOn(){
StyleConstants.setBold(set,true);//this method, and the three following it, could well be lines of code instead of methods.
}
privatevoid setBoldOff(){
StyleConstants.setBold(set,false);
}
privatevoid setItalicsOn(){
StyleConstants.setItalic(set,true);
}
privatevoid setItalicsOff(){
StyleConstants.setItalic(set,false);
}
and:
currentDocument.insertString(currentDocument.getLength(), currentToken, set);
And for some reason, they don't seem to work together, any ideas why they refuse to nest?
Thank-you in advance.
Edit:
Where:private StyledDocument currentDocument;
private SimpleAttributeSet set =new SimpleAttributeSet();
Message was edited by:
abu5e

