Code example for JTextComponent

Methods: isEditable

	 * {@inheritDoc} 
	public Shape paintLayer(final Graphics g, final int i, final int j, final Shape shape, final JTextComponent jtext,
	                        final View view) {
		if (jtext.isEditable()) {
			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; 
Connect your IDE to all the code out there  Get Codota for Java