Here you can find the source of paintGradientSelection(Color topLineColor, Color bottomLineColor, Color topGradientColor, Color bottomGradientColor, Graphics2D graphics2D, int width, int height)
private static void paintGradientSelection(Color topLineColor, Color bottomLineColor, Color topGradientColor, Color bottomGradientColor, Graphics2D graphics2D, int width, int height)
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 Zeljko Zirikovic.//w w w . ja va2 s .co m * All rights reserved. This program and the accompanying materials * are made available under the terms of the GPL which * accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html ******************************************************************************/ import java.awt.Color; import java.awt.GradientPaint; import java.awt.Graphics2D; public class Main { private static void paintGradientSelection(Color topLineColor, Color bottomLineColor, Color topGradientColor, Color bottomGradientColor, Graphics2D graphics2D, int width, int height) { GradientPaint paint = new GradientPaint(0, 1, topGradientColor, 0, height - 2, bottomGradientColor); graphics2D.setPaint(paint); graphics2D.fillRect(0, 0, width, height); graphics2D.setColor(topLineColor); graphics2D.drawLine(0, 0, width, 0); graphics2D.setColor(bottomLineColor); graphics2D.drawLine(0, height - 1, width, height - 1); } }