求助:请高手指点用Applet制作数据结构算法的动态演示的步骤 请高手指点用Applet制作数据结构算法的动态演示的步骤,小妹正在做这个毕业设计,但不知道如何入手,还请各位高人指点一下!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 本科还是研究生啊?无论哪个好像这个都比较有难度(要是要求互动并且自己做的话)。不仅仅需要非常熟悉applet和多线程,还得精通数据结构、还得会编码...如果仅仅是死的演示那简单了。搜一下先吧... applet和多线程 我好象没问题 数据结构算法???没明白。。要演示什么?? 就像严蔚敏老师的数据结构的那个软件一样,只不过我这个是需要用JAVA Applet实现,请高手指点啊! 严蔚敏老师的数据结构是什么样??汗了吧也晕了吧姐姐您是不是想 在APPLET页面里面输入一些数据然后 用算法实现并且显示。。 动态演示 使用多线程 还可能需要使用event姐姐您能把您要演示什么样具体说一下?(比如画出一些曲线)非常抱歉 我对数据结构之知道一些简单概念 (演示树 我不是很明白要演示什么)我也不是什么高手但是给你写帮助还可以的 //animation.javaimport java.awt.*;import java.awt.event.*;import java.applet.Applet;public class animation1 extends Applet implements Runnable,ActionListener{ Thread hThread; int xx=0,yy=0; int x=0; Label label1; public void init() { this.setBackground(Color.lightGray); label1=new Label("眤翴诀琌: "); this.add(label1); Button myButton1=new Button("秨﹍"); myButton1.addActionListener(this); this.add(myButton1); Button myButton2=new Button("既氨"); myButton2.addActionListener(this); this.add(myButton2); Button myButton3=new Button("膥尿"); myButton3.addActionListener(this); this.add(myButton3); } public void start() { //创建线程 if(hThread==null) hThread=new Thread(this); //启动线程 } public void actionPerformed(ActionEvent e) { if(e.getActionCommand()=="秨﹍") { //显示提示消息 label1.setText("眤翴诀琌:秨﹍"); hThread.start(); } if(e.getActionCommand()=="既氨") { label1.setText("眤翴诀琌:既氨"); hThread.suspend(); } if(e.getActionCommand()=="膥尿") { label1.setText("眤翴诀琌:膥尿"); hThread.resume(); } } public void run() { //线程run方法 while(true) { repaint(); try { //线程睡眠时间 hThread.sleep(20); } catch(InterruptedException e) {} } } public void paint(Graphics g) { for(int x1=0;x1<=x;x1++) { double y1=200.0+100.0*Math.sin((double)x1*Math.PI/180.0); int x11=x1+1; double y11=200.0+100.0*Math.sin((double)x11*Math.PI/180.0); g.drawLine(x1,(int)y1,x11,(int)y11); } x++; if(x>360)x=0; double y=200.0+100.0*Math.sin((double)x*Math.PI/180.0); g.drawLine(xx,yy,x,(int)y); xx=x; yy=(int)y; } public void stop() { hThread= null; } }以前写的画曲线程序 动态显示的 需要帮助+msn:xizhiyao_0221@hotmail 或EMAIL:[email protected] 我加了你的MSN,一开始弄错了,现在好了!不知道你上线了没?谢谢! Java 上传视频 并截图 我想做一个智能点的粘贴板.java能够捕获别的程序下的ctr+C键吗 java初学者怎么样才能学好java? 请问我如何才能学好API 关于JTree改变焦点的问题 奇怪的问题 protected成员的访问方法 金蝶BOS开发的前景 Swing里头的汉字都显示成方框,怎么解决? 关于静态属性的一个问题 新手问题,谢谢达人们指教 DateFormat类不懂
不仅仅需要非常熟悉applet和多线程,还得精通数据结构、还得会编码...
如果仅仅是死的演示那简单了。
搜一下先吧...
姐姐您是不是想 在APPLET页面里面输入一些数据然后 用算法实现并且显示。。
姐姐您能把您要演示什么样具体说一下?(比如画出一些曲线)
非常抱歉 我对数据结构之知道一些简单概念 (演示树 我不是很明白要演示什么)
我也不是什么高手但是给你写帮助还可以的
//animation.java
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;public class animation1 extends Applet implements Runnable,ActionListener
{
Thread hThread;
int xx=0,yy=0;
int x=0;
Label label1;
public void init()
{
this.setBackground(Color.lightGray);
label1=new Label("眤翴诀琌: ");
this.add(label1);
Button myButton1=new Button("秨﹍");
myButton1.addActionListener(this);
this.add(myButton1);
Button myButton2=new Button("既氨");
myButton2.addActionListener(this);
this.add(myButton2);
Button myButton3=new Button("膥尿");
myButton3.addActionListener(this);
this.add(myButton3);
}
public void start()
{
//创建线程
if(hThread==null)
hThread=new Thread(this);
//启动线程
}
public void actionPerformed(ActionEvent e)
{
if(e.getActionCommand()=="秨﹍")
{
//显示提示消息
label1.setText("眤翴诀琌:秨﹍");
hThread.start();
}
if(e.getActionCommand()=="既氨")
{
label1.setText("眤翴诀琌:既氨");
hThread.suspend();
}
if(e.getActionCommand()=="膥尿")
{
label1.setText("眤翴诀琌:膥尿");
hThread.resume();
}
}
public void run()
{
//线程run方法
while(true)
{
repaint();
try
{
//线程睡眠时间
hThread.sleep(20);
}
catch(InterruptedException e)
{}
}
}
public void paint(Graphics g)
{
for(int x1=0;x1<=x;x1++)
{
double y1=200.0+100.0*Math.sin((double)x1*Math.PI/180.0);
int x11=x1+1;
double y11=200.0+100.0*Math.sin((double)x11*Math.PI/180.0);
g.drawLine(x1,(int)y1,x11,(int)y11);
}
x++;
if(x>360)x=0;
double y=200.0+100.0*Math.sin((double)x*Math.PI/180.0);
g.drawLine(xx,yy,x,(int)y);
xx=x;
yy=(int)y;
}
public void stop()
{
hThread= null;
}
}
以前写的画曲线程序 动态显示的