Code example for JTextComponent

Methods: getSelectionColor

0
		} 
 
		// Set the color (our own if defined, otherwise text area's). 
		Paint paint = getPaint();
		if (paint==null)
			g2d.setColor(c.getSelectionColor());
		else 
			g2d.setPaint(paint);
 
		// Contained in view, can just use bounds. 
		if (offs0==view.getStartOffset() && offs1==view.getEndOffset()) {
 
			Rectangle alloc;
			if (bounds instanceof Rectangle)
				alloc = (Rectangle)bounds;
			else 
				alloc = bounds.getBounds();
			 
			g2d.fillRect(alloc.x, alloc.y, alloc.width, alloc.height);
 
Experience pair programming with AI  Get Codota for Java