try {
String text;
text = colorPane.getText();
System.out.println("Caret : " + colorPane.getCaretPosition());
EditState es = EditColumnsModel.getInstance().createStyledTokens(text,
caretPosition);
colorPane.colorize(es.getTokens());
if (es.getErrorText().equals("")){
jlErreur.setForeground(Color.gray);
jlErreur.setText("Tout est Ok :)");
}else{
jlErreur.setForeground(Color.red);
jlErreur.setText(es.getErrorText());
}
jbOk.setEnabled(es.isOkState());
undoAction.setEnabled(es.isUndoState());
redoAction.setEnabled(es.isRedoState());
} catch (Exception ex) {
System.err.println("Exception updateText" + ex);
return;
}