java五子棋棋子画法

publicclassDrawFrame{

publicstaticvoidmain(String[]args){

finalJFrameframe=newJFrame();

frame.setContentPane(newJPanel(){

@Override

publicvoidpaint(Graphicsg){

super.paint(g);

Graphics2Dg2d=(Graphics2D)g;

RadialGradientPaintpaint=newRadialGradientPaint(65,65,50,newfloat[]{0f,1f},newColor[]{Color.WHITE,Color.BLACK});

g2d.setPaint(paint);

g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);

g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT);

Ellipse2De=newEllipse2D.Float(10,10,100,100);

g2d.fill(e);

}

});

frame.setVisible(true);

}

}

黑白棋。

Graphics2Dg2d=(Graphics2D)g;

RadialGradientPaintpaint=newRadialGradientPaint(65,60,50,newfloat[]{0f,0.5f,1f},newColor[]{Color.WHITE,Color.BLUE,Color.BLACK});

g2d.setPaint(paint);

g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);

g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT);

Ellipse2De=newEllipse2D.Float(10,10,100,100);

g2d.fill(e);

这个是斯诺克球。

免责声明:本站发布的游戏攻略(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场。
如果本文侵犯了您的权益,请联系站长邮箱进行举报反馈,一经查实,我们将在第一时间处理,感谢您对本站的关注!