标题:画椭圆的问题,新手,错哪里了,记事本写的
只看楼主
NeQhk
Rank: 2
等 级:论坛游民
威 望:1
帖 子:164
专家分:85
注 册:2014-7-19
结帖率:69.23%
已结贴  问题点数:15 回复次数:1 
画椭圆的问题,新手,错哪里了,记事本写的
import java.swing.Applet;
import java.AWT.Graphics;

class Eclipse
{
   public static void main(String[] args)
  {
     canvas drawoval(100.200,20,20);
     canvas filloval(130,230,12,20);
     canvas filloval(180,230,12,20);
     canvas drawarc(140,260,12,18,180,180);
   }
}
搜索更多相关主题的帖子: 记事本 public import 
2015-03-09 17:08
日知己所无
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:38
帖 子:427
专家分:2071
注 册:2014-3-22
得分:15 
程序代码:
import javax.swing.*;
import java.awt.*;

public class Eclipse extends Canvas {
    public Eclipse() {
    }

    public static void main(String[] args) {
        JFrame frame = new JFrame();

        frame.getContentPane().add(new Eclipse());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(400, 400);
        frame.setVisible(true);
    }

    public void paint(Graphics canvas) {
        canvas.drawOval(100, 200, 20, 20);
        canvas.fillOval(130, 230, 12, 20);
        canvas.fillOval(180, 230, 12, 20);
        canvas.drawArc(140, 260, 12, 18, 180, 180);
    }
}
2015-03-09 20:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-442475-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.265484 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved