⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drawpanel.java

📁 java相关的j2me,j2se的一些相关资料
💻 JAVA
字号:
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
/*
 * DrawPanel.java
 *
 * Created on 2007年3月21日, 下午7:34
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author wmh
 */
public class DrawPanel extends JPanel{
    
    /** Creates a new instance of DrawPanel */
    public DrawPanel() {
    }
    protected void paintBorder(Graphics g){
        g.setColor(Color.RED);
        g.fillRect(0,0,100,20);
    }
    protected void paintChildren(Graphics g){
        g.setColor(Color.BLUE);
        g.fillOval(0,21,120,20);
        
    }
    protected void paintComponent(Graphics g){
        g.setColor(Color.GREEN);
        g.fillOval(0,42,120,20);        
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -