Code example for JTextComponent

Methods: isEditable

0
	 * {@inheritDoc} 
	 */ 
	@Override 
	public Shape paintLayer(final Graphics g, final int i, final int j, final Shape shape, final JTextComponent jtext,
	                        final View view) {
		if (jtext.isEditable()) {
			g.setColor(Color.red);
			try { 
				final Shape sh = view.modelToView(i, Position.Bias.Forward, j, Position.Bias.Backward, shape);
				final Rectangle rect = (sh instanceof Rectangle) ? (Rectangle) sh : sh.getBounds();
				drawZigZagLine(g, rect);
				return rect;
			} 
			catch (final BadLocationException badlocationexception) {
				return null; 
			} 
		} 
		return null; 
	} 
}