public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
Color startColor = Color.red;
Color endColor = Color.blue;
// A non-cyclic gradient
GradientPaint gradient = new GradientPaint(startX, startY, startColor, endX, endY, endColor);
g2d.setPaint(gradient);
// Draw shapes...; see e586 Drawing Simple Shapes
// A cyclic gradient
gradient = new GradientPaint(startX, startY, startColor, endX, endY, endColor, true);
g2d.setPaint(gradient);
// Draw shapes...; see e586 Drawing Simple Shapes
}
|
e583. Drawing with a Gradient Color
最新推荐文章于 2022-04-20 10:23:26 发布
2万+

被折叠的 条评论
为什么被折叠?



