用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字
云代码 - java代码库

坦克大战3

2015-03-15 作者: 云代码会员举报

[java]代码库

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
 
package tank;
 
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JPanel;
 
 class T extends JFrame {
 
    small mp = null;
//    GuanQia gqmb  =null;
    public static void main(String[] args) {
        T t = new T();
    }
 
    public T() {
       mp = new small();
 
   //     gqmb = new GuanQia();
         
   //     this.add(gqmb);
       this.add(mp);
 
        this.setSize(600,500);
        this.setLocation(300, 280);
        this.setDefaultCloseOperation(3);
        this.setVisible(true);
    }
}
 
 
 
 
 
public class small extends JPanel {
    public small(){
         
    }
     
     public void paint(Graphics g) {
         super.paint(g);
          g.fillRect(0, 0, 500, 400);
           
          this.drawTank(0, 0, g);
     }
     public void drawTank(int x, int y,Graphics g){
          
         g.setColor(Color.red);
            g.fill3DRect(x, y, 5, 30, false);
                g.fill3DRect(x + 15, y, 5, 30, false);
                g.fill3DRect(x + 5, y + 5, 10, 20, false);
                g.fillOval(x + 5, y + 10, 10, 10);
                g.drawLine(x + 10, y + 15, x + 10, y - 5);
     }
      
}


网友评论    (发表评论)

共1 条评论 1/1页

发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。


扫码下载

加载中,请稍后...

输入口令后可复制整站源码

加载中,请稍后...