@Override
    public void mouseReleased(MouseEvent e) {
        if (e.getButton() == MouseEvent.BUTTON1) {
            left = false;
        }
        if (e.getButton() == MouseEvent.BUTTON3) {
            ((Component) e.getSource()).setCursor(Cursor.getDefaultCursor());
            right = false;
        }
        if (e.getPoint().x >= 0 && e.getPoint().x <= getWidth() && e.getPoint().y >= 0 && e.getPoint().y <= getHeight())
            getParent().repaint();
    }