I want to paint my MandelbrotSet, that I've made yesterday, now outside of Greenfoot. Therefore I have a JFrame with a JLabel with a size of 600x400. Now my problem is, that I use some classes wrong, but I don't know how. The painting of the set works in Greenfoot. Here is the important part of the code (I'm unexperienced in tis materia):
disp is the JLabel. There is now failure in the Mandelbrot set calculating. It has to be in the usage of the java classes.
public void drawM(double xMin, double xMax, double yMin, double yMax){ calcIterationLimit(); double w = (double) disp.getWidth(); double h = (double) disp.getHeight(); double dx = xMax-xMin; double dy = yMax-yMin; Graphics b = disp.getGraphics();//IMPORTANT for(double x = 0; x < disp.getWidth(); x++){ for(double y = 0; y < disp.getHeight(); y++){ double mx = ((dx/w)*x)+xMin; double my = ((-dy/h)*y)+yMax; Color color = calcColorFor(mx, my); b.setColor(color);//IMPORTANT b.drawRect((int) x, (int) y, (int) x, (int) y);//IMPORTANT } } ImageIcon icon = new ImageIcon();//IMPORTANT icon.paintIcon(disp, b, disp.getWidth(), disp.getHeight());//IMPORTANT disp.setIcon(icon);//IMPORTANT }