有没有人用java画过动态正弦曲线图啊!100分求救,急 好像有,你下在jfreechart,里面有有各可运行的例子,其中好像动态正弦曲线图 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 呵呵,cxz7531大哥,我不是想赶紧做完回家过年吗? 哈哈!! 我也想快点挣点分好过年,好了,给你调好了类文件import java.awt.Graphics;public class GraphApplet extends java.applet.Applet { double f(double x) { return Math.sin(x/12.0) * 200.0 / 4+100; } 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)); } } public String getAppletInfo() { return "Draws a sin graph."; }}测试页面<html> <head> <title>Simple Graph (1.1)</title> </head> <body> <h1>Simple Graph(1.1)</h1> <hr> <applet code=GraphApplet.class width=900 height=400> </applet> <hr> <a href="GraphApplet.java">The source</a>. </body></html> 建议你去看看JAVA自带的演示程序!! 相对路径读文件问题,比较急 一个extends JFrame 的类 如何加入工具栏, 然后可以设置一些图标 奇怪的问题关于Long.parseLong() 为什么打印不出"\b"啊 jdbc EOFException问题 winme下能运行tomcat4.1吗?能运行servlet程序吗? 在java中有没有数据库控件,例如jdbTable,但是是以ResultSet作为参数? 赋值给lable中的字串,如何换行? session的问题 关于try catch的一个小问题,请大家指点一下 swt如何动态调用composite?100分!进来就有!谢谢! 用J2SE写手机程序成为现实!
类文件
import java.awt.Graphics;public class GraphApplet extends java.applet.Applet {
double f(double x) {
return Math.sin(x/12.0) * 200.0 / 4+100;
} 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));
}
} public String getAppletInfo() {
return "Draws a sin graph.";
}
}测试页面
<html>
<head>
<title>Simple Graph (1.1)</title>
</head>
<body>
<h1>Simple Graph(1.1)</h1>
<hr>
<applet code=GraphApplet.class width=900 height=400>
</applet>
<hr>
<a href="GraphApplet.java">The source</a>.
</body>
</html>