I am trying to change paint as my appplet does some computationns (please see the code below) so that when I use repaint, I paint something new. How is this done in java?
Thank you very much!
java
package com.guilherme.main;
import javax.swing.JApplet;
import java.lang.Math;
import com.guilherme.investorRelated.VectorOfInvestors;
import com.guilherme.marketRelated.StockMarket;
import java.awt.Graphics;
public class RunnerApplet extends JApplet{
/**
*
*/
private static final long serialVersionUID = 1L;
public void init()
{this.resize(500,500);
}
public void start()
{
for (int i=0; i<2; i++)
//SOMETHING SHOULD BE CHANGING stockHistoryAux HERE
{repaint(); }
}
public void stop()
{}
public void paint(Graphics grafo)
{
int[] Ycoordinates = stockHistoryAux;
int[] Xcoordinates = {10,20,30,40,50,60,70,80,90,100};
grafo.drawPolyline(Xcoordinates,Ycoordinates,i);
}
}
}
*edit: Modified your code tags so they would work. Thanks for using them.
This post has been edited by Martyr2: 18 Mar, 2008 - 12:35 PM