graphapplet.java

来自「几个java的程序」· Java 代码 · 共 14 行

JAVA
14
字号
import java.awt.Graphics;public class GraphApplet extends java.applet.Applet {    double f(double x) {	return (Math.cos(x/5) + Math.sin(x/7) + 2) * getSize().height / 4;    }    public void paint(Graphics g) {        for (int x = 0 ; x < getSize().width ; x++) {	    g.drawLine(x, (int)f(x), x + 1, (int)f(x + 1));        }    }}

⌨️ 快捷键说明

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