public synchronized void drawWaveForm(final Canvas c) {
        new Thread(new Runnable() {
            // implement functionality for anstract run
            public void run() {
                try {
                    setParent(c);
                    setDisplayMode(new DisplayMode((int) canvassize, 103));
                    create();

                } catch (LWJGLException e) {
                    e.printStackTrace();
                }
                // init OpenGL
                glMatrixMode(GL_PROJECTION);
                glLoadIdentity();
                glOrtho(0, canvassize, 0, 103, 1, -1);
                glMatrixMode(GL_MODELVIEW);

                while (!isCloseRequested()) {

                    if (selected) {
                        if (firstRun) {
                            if (canvassizeChanged) {
                                glViewport(0, 0, (int) canvassize, 103);
                                // init OpenGL
                                glMatrixMode(GL_PROJECTION);
                                glLoadIdentity();
                                glOrtho(0, canvassize, 0, 103, 1, -1);
                                glMatrixMode(GL_MODELVIEW);
                                canvassizeChanged = false;
                            }
                            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                            float[] c = getColors();
                            // set the color of the quad (R,G,B,A)
                            glColor3f(c[0], c[1], c[2]);
                            firstRun = false;

                            drawRectangles(canvassize);
                            update();
                        }

                    } else {
                        // if something is still displaying, clear it
                        if (firstRun == false) {
                            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                            firstRun = true;
                            update();
                        }
                    }

                    try {
                        Thread.sleep(10);
                    } catch (InterruptedException ex) {
                    }
                }
                destroy();
            }
        }).start();

    }