java为图形填充颜色
importjava.awt.*;importjava.awt.event.*;publicclasspaintingextendsFrame{publicpaintin...
import java.awt.*;import java.awt.event.*;public class painting extends Frame {public painting() {super("painting"); setSize(400,350); setVisible(true); } public static void main(String args[]) {painting app= new painting(); app.addWindowListener(new Handler1()); } public void paint(Graphics g) { g.drawOval(180,180,120,120); } static class Handler1 extends WindowAdapter {public void windowClosing(WindowEvent e) {System.exit(0); } }}所画图形是一个圆,请各位高手大侠们帮下忙,添加代码能将“圆填充为红色”
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询