一
關於
二
在網絡通訊中
具體實現很簡單
import java
import java
import javax
import twaver
public class PipleComponent extends JComponent {
public void paint(Graphics g) {
Graphics
g
Shape parentHollowShape=createPiple(g
createPiple(g
createPiple(g
createPiple(g
createPiple(g
}
private Shape createPiple(Graphics
if(parentHollowShape!=null){
Rectangle bounds=parentHollowShape
Rectangle rightClip=new Rectangle(bounds
Area clip=new Area(parentHollowShape);
clip
g
}
int circleWidth = height/
GradientPaint paint = new GradientPaint(x
y
color
x
y + (int) (height *
color
true);
g
Ellipse
Ellipse
int thickness=
Ellipse
rightCircle
rightCircle
rightCircle
Rectangle rect = new Rectangle(x
Area area = new Area(leftCircle);
area
area
g
g
g
paint = new GradientPaint(x
y
Color
x
y + (int) (height *
Color
true);
g
g
g
return rightHollowCircle;
}
public static void main(String[] args) {
JFrame frame = new JFrame();
frame
frame
frame
frame
}
}
三
本文知識要點
漸變填充
使用Clip
Area的使用
使用隨機色
如果大家感興趣
六
l
~hall/java/l
From:http://tw.wingwit.com/Article/program/Java/hx/201311/25811.html