pic.java

来自「java编程100例」· Java 代码 · 共 49 行

JAVA
49
字号
package statistics;import java.awt.*;import java.awt.event.*;import java.applet.*;public class pic extends Applet {  Color color1=new Color(255,0,0);  Color color2=new Color(0,255,0);  Color color3=new Color(0,0,255);  boolean isStandalone = false;  /**Get a parameter value*/  public String getParameter(String key, String def) {    return isStandalone ? System.getProperty(key, def) :      (getParameter(key) != null ? getParameter(key) : def);  }  public void paint(Graphics g){  g.setColor(color1);  g.drawString("统计图",40,60);  g.fillArc(100,100,100,100,0,30);  g.setColor(color2);  g.fillArc(100,100,100,100,30,170);  g.setColor(color3);  g.fillArc(100,100,100,100,200,160);  }  /**Construct the applet*/  public pic() {  }  /**Initialize the applet*/  public void init() {    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  /**Component initialization*/  private void jbInit() throws Exception {  }  /**Get Applet information*/  public String getAppletInfo() {    return "Applet Information";  }  /**Get parameter info*/  public String[][] getParameterInfo() {    return null;  }}

⌨️ 快捷键说明

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