i have been experimenting with the mandelbrot java thing and i seem to be stuck on drawing the image.I used a JFrame and Jpanel to create this. I know the for loops are wrong as I've just been experimenting with it.
public Mandelbrot(){
JFrame mandelSet = new JFrame("Mandelbrot Set");
mandelSet.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE);
mandelSet.setSize(400,300);
mandelSet.setVisible(true);
JPanel picture = new JPanel();
mandelSet.setContentPane(picture);
picture.setLayout(new FlowLayout());
for(int y =0; y<200; y++){
for(int x=0; x<200; x++){
while(rx*rx +ix*ix <4 && iteration>0){
tmp = rx*rx -ix*ix +ry;
ix = 2.0*rx*ix+iy;
rx=tmp;
iteration--;
}
I.setRGB(x, y, iteration | iteration <<100);
}
}
}
public void paint(Graphics g){
g.drawImage(I,0,0,this);
}
The draw method seems to be giving me a compilation error. i saw that on the internet but it doesnt seem to work.