public ChessPanel() {
    super();

    this.mainPanel.setLayout(null);

    this.setContentPane(this.mainPanel);
    this.initBackground(this.mainPanel);
    this.initBlockLabel(this.mainPanel);

    this.mainPanel.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent e) {
        Component item = mainPanel.getComponentAt(e.getPoint());
        if (item == null || !(item instanceof BoardBlockLabel)) {
          return;
        }
        BoardBlock block = ((BoardBlockLabel) item).getMode();
        if (board.getSelectedBlock() != null) {
          board.moveTo(block.getPos());
        } else if (!block.isBlank()) {
          board.setSelectedBlock(block);
        }
      }
    });

    this.board.addListener(new ChessBoard.BoardListener() {
      @Override
      public void reset(ChessBoard board) {
        repaint();
      }

      @Override
      public void move(Point from, Point to) {
        if (moveMark[0] != null) {
          moveMark[0].setMarked(false);
        }
        moveMark[0] = labels[from.y][from.x];
        if (moveMark[1] != null) {
          moveMark[1].setMarked(false);
        }
        moveMark[1] = labels[to.y][to.x];
        
        moveMark[0].setMarked(true);
        moveMark[1].setMarked(true);
      }
    });
    this.addKeyListener(new KeyAdapter() {
      @Override
      public void keyPressed(KeyEvent e) {
        char c = e.getKeyChar();
        if (c == 'r') {
          loadRecord(record);
        }
        if (c == 'd') {
          nextStepInRecord();
        }
        if (c == 'a') {
          stepBack();
        }
      }
    });
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    this.pack();
    this.setLocationRelativeTo(null);
  }