public void render() {

        BufferStrategy bs = getBufferStrategy();

        if (bs == null) {

            createBufferStrategy(2);
            return;
        }

        Graphics g = bs.getDrawGraphics();

        g.setColor(Color.lightGray);
        g.fillRect(0, 0, getWidth(), getHeight());

        //drawing is done here
        ////////
        for (int i = 0; i < klusterSet.length; i++) {

            if (klusterSet[i].returnC() == 0) {
                g.setColor(Color.BLUE);
            }
            if (klusterSet[i].returnC() == 1) {
                g.setColor(Color.RED);
            }
            if (klusterSet[i].returnC() == 2) {
                g.setColor(Color.WHITE);
            }

            g.drawOval((int) (klusterSet[i].returnX() * 10 + 50), (int) (-klusterSet[i].returnY() * 5 + 200), 5, 5);

            g.drawString("The position of k-mean " + i + " is X: " + klusterSet[i].returnX() + " and Y: " + klusterSet[i].returnY(), 10, 20 + i * 15);

        }

        for (int j = 0; j < tempE.length; j++) {//readFile.tempE.length

            if (colourArray[j] == 0) {
                g.setColor(Color.BLUE);
            }
            if (colourArray[j] == 1) {
                g.setColor(Color.RED);
            }
            if (colourArray[j] == 2) {
                g.setColor(Color.WHITE);
            }
            g.drawOval((int) (tempE[j][0] * 10 + 50), ((int) -tempE[0][j] * 5 + 200), 5, 5);

        }

        ///////
        g.dispose();
        bs.show();
    }