thnx... now i need a way to improve Displaying of Objects on a Frame or Panel.
Because if i use this code :
import java.util.*;
import java.awt.*;
public class Start extends Frame{
int max = 9999;
MyButton b = new MyButton();
public Start(){
SpyTimer st = new SpyTimer();
setSize(640,480);
Vector v = null;
st.start();
v = createClone();
st.printTime("fin de creation des " + String.valueOf(max) + " bouttons");
for(int i=0;i<max;i++)>
add((MyButton)v.get(i));
setLayout(new FlowLayout());
setVisible(true);
st.printFinal();
}
public Vector createNew(){
Vector v1 = new Vector();
for(int i=0;i<max;i++)>
v1.addElement(new MyButton());
return v1;
}
public Vector createClone(){
Vector v = new Vector();
for(int i=0;i<max;i++)>
v.addElement((MyButton)b.clone());
return v;
}
public static void main(
String args[]){
new Start();
}
private class MyButton extends Button implements Cloneable{
public Object clone(){
Object bTemp = null;
try{
bTemp = super.clone();
}
catch(Exception e){System.out.println("Erreur");}
return bTemp;
}
}
}
it take a huge time to display all the objects....
re thnx for any help ! ;-)