繪圖.java(小程式查看器)

來源:互聯網
上載者:User

標籤:繪圖

//<applet code=Draw.class width=400 height=300></applet>import java.awt.*;import java.applet.*;    public class Draw extends Applet    {        public void paint(Graphics g)        {            g.setColor(Color.YELLOW);            g.drawLine(0,0,100,100);//畫線從(0,0)到(100,100)            g.setColor(Color.BLUE);            g.fillRect(125,25,50,40);//畫實心矩形,起點(125,25),大小50X40            g.setColor(Color.RED);            g.drawRect(225,25,50,40);//畫空心矩形,起點(225,25),大小50X40            g.setColor(Color.GREEN);            g.drawRoundRect(325,25,50,40,10,8);//畫圓角矩形,起點(325,25),大小50X40,圓角10X8            g.setColor(Color.ORANGE);            g.fill3DRect(25,125,50,40,true);//畫一個3D效果的實心矩形,起點(25,125),大小50X40        }    }

步驟:

650) this.width=650;" src="http://img.blog.csdn.net/20150724025856742" alt="這裡寫圖片描述" title="" />

結果:

650) this.width=650;" src="http://img.blog.csdn.net/20150724025947873" alt="這裡寫圖片描述" title="" />


本文出自 “桑海田 部落格專欄” 部落格,請務必保留此出處http://10602803.blog.51cto.com/10592803/1683072

繪圖.java(小程式查看器)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.