public void paintComponent(Graphics g)
    {
        //System.out.println(String.format("Action painted x:%d, y:%d", centerX, centerY));

        g.setColor(Color.black);
        g.drawRect(centerX - width/2, centerY - height/2, width, height);

        String text = null;
        if (diskNum != -1) {
            text = String.format("hb(%s, %s, %s, %d) {nuo %s ant %s per %s, %d disk%s}", x.name, y.name, z.name, diskNum, x.name, y.name, z.name, diskNum, getLitEndingFor(diskNum));
        }
        else {
            text = String.format("%d. Perkeliama nuo %s ant %s.", TowersOfHanoi.moveCount, x.name, y.name);
        }
        g.drawString(text, centerX - width/2 + 5, centerY - height/2 + 15);

        movePegsHere();

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