java如何绘制哆啦A梦?本篇文章小编给大家分享一下java绘制哆啦A梦代码示例,绘制的哆啦A梦超可爱,小编觉得挺不错的,现在分享给大家供大家参考,有需要的小伙伴们可以来看看。
以下是画出哆啦a梦的代码
package com;
import javax.swing.*;
import java.awt.*;
public class dlam extends JFrame{
public dlam() {
this.setTitle("哆啦A梦");
this.setVisible(true);
this.setSize(370,460);
}
public void paint(Graphics graphics) {
super.paint(graphics);
graphics.setColor(Color.white);
graphics.fillRect(0, 0, 370, 450);
Color blue = new Color(0,100,255);
graphics.setColor(blue);
graphics.fillOval(65,60,240,230);
graphics.fillRect(109, 290, 150, 120);
int xValues[] = {109,7