how can i change part of a jtextpane?

From: Peter Wieser (p.troxler_at_hispeed.ch)
Date: 05/30/04

  • Next message: Robert Kocher: "Connection Problem with MySQL"
    Date: Sun, 30 May 2004 17:45:49 +0100
    
    

    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???


  • Next message: Robert Kocher: "Connection Problem with MySQL"