seText is InlineCssTextArea
Here I try to set the style by selecting the first line :
seText.setStyle(seText.getCurrentParagraph(),seText.getSelection().getStart(),seText.getSelection().getEnd(),ControlColorPane.getSelectedColor());
System.out.println(seText.getSelection());
I get good results

Output : 0, 5
But when I select the second line ans try changing the color

Get Caused by: java.lang.IndexOutOfBoundsException: [6, 11) is not a valid range within [0, 5)
Output : 6, 11
and the style does not change either
seTextisInlineCssTextAreaHere I try to set the style by selecting the first line :
seText.setStyle(seText.getCurrentParagraph(),seText.getSelection().getStart(),seText.getSelection().getEnd(),ControlColorPane.getSelectedColor());System.out.println(seText.getSelection());I get good results
Output : 0, 5

But when I select the second line ans try changing the color
Get
Caused by: java.lang.IndexOutOfBoundsException: [6, 11) is not a valid range within [0, 5)Output : 6, 11
and the style does not change either