P
Peter Wieser
I want to change the backgroundcolor for a few lines in a jtextpane. I do
not want to change it like
MutableAttributeSet hilight=new SimpleAttributeSet();
StyleConstants.setBackground(hilight,new Color(230,230,180));
styledDoc.setCharacterAttributes(anf,end-anf,hilight,false);
because when I do so, only the characters change their background; but I
want that the new
background has a rectangle shape. So my Problem is the following: I have the
indices of the
first and last character in the jtextpane and want, that this area has a new
rectangular backround
color. I guess I have to do something with fillRect on the jTextPane, right?
But how???
not want to change it like
MutableAttributeSet hilight=new SimpleAttributeSet();
StyleConstants.setBackground(hilight,new Color(230,230,180));
styledDoc.setCharacterAttributes(anf,end-anf,hilight,false);
because when I do so, only the characters change their background; but I
want that the new
background has a rectangle shape. So my Problem is the following: I have the
indices of the
first and last character in the jtextpane and want, that this area has a new
rectangular backround
color. I guess I have to do something with fillRect on the jTextPane, right?
But how???