public void paintComponent(Graphics g)
    {
        g.setColor(Color.black);
        g.drawArc(centerX-Peg.width*2, centerY-Peg.height*2, Peg.width*4, Peg.height*4, -45, 270);

        String text;
        if (type == 0) { // clockwise
            // get the points by the ellipsis equation
            int arrowX = (int)Math.ceil(Peg.width*2 * Math.cos(Math.PI/4) + centerX);
            int arrowY = (int)Math.ceil(Peg.height*2 * Math.sin(Math.PI/4) + centerY);

            // lower arrow side
            g.drawLine(arrowX, arrowY, arrowX + 20, arrowY - 4);
            // upper arrow side
            g.drawLine(arrowX, arrowY, arrowX + 10, arrowY - 20);

            text = "Diskų skaičius lyginis - diskai perkeliami pagal laikrodžio rodyklę.";
        }
        else { // counter-clockwise
            // get the points by the ellipsis equation
            int arrowX = (int)Math.ceil(Peg.width*2 * Math.cos((Math.PI/4)*3) + centerX);
            int arrowY = (int)Math.ceil(Peg.height*2 * Math.sin((Math.PI/4)*3) + centerY);

            // lower arrow side
            g.drawLine(arrowX, arrowY, arrowX - 20, arrowY - 4);
            // upper arrow side
            g.drawLine(arrowX, arrowY, arrowX - 10, arrowY - 20);
            g.drawLine(arrowX, arrowY, arrowX - 10, arrowY - 20);

            text = "Diskų skaičius nelyginis - diskai perkeliami prieš laikrodžio rodyklę.";
        }

        //g.drawString(text, centerX - Peg.width*2, centerY + Peg.height*2 + 10);
        TowersOfHanoi.setCaption("Iteratyvus sprendimas. "+text);

        x.paintComponent(g);
        y.paintComponent(g);
        z.paintComponent(g);
    }