James II became King of England in 1685 and New York became a royal colony. James II decreed the formation of the Dominion of New England in 1686 and added the colonies of New York and New Jersey in May 1688, designating New York City as the capital.

In late 1688, the Glorious Revolution deposed James II for his Catholicism. This showed that people could replace an unsuitable ruler. There were uprisings against royal governors in the colonies. James' newly appointed governor of New England, Edmund Andros, was unpopular due to strictly enforcing the Navigation Acts and posing other restrictions on colonists. He was sent back to England.

Leisler's Rebellion was an uprising in colonial New York, reflecting colonial resentment against the policies of King James II. An armed mob seized Fort James and intended to hold New York for William III and Mary II. Captain Jacob Leisler became the head of a new government of direct popular representation in lower New York from 1689 to 1691. This government was not dominated by the wealthy merchants and landowners and tried to distribute wealth to the poor. New York's predominantly Anglican merchant and aristocratic classes and the Albany Convention opposed Leisler's rule.
^from the internet

If James was disposed of during the Glorious Revolution, why did Leisler and his followers resent James II policies?

Leisler and his followers resented James II's policies because his reign was marked by a series of unpopular measures that infringed upon the rights and privileges of the colonists. James II, being a Catholic ruler, faced strong opposition from Protestant factions in England and the colonies. His policies were seen as favoring Catholics and disregarding the interests of the Protestant majority. This created a sense of resentment and a desire for change among the colonists.

Specifically, James II's newly appointed governor of New England, Edmund Andros, enforced the Navigation Acts rigorously, which were a set of trade laws that restricted colonial commerce and favored English merchants. These policies were seen as detrimental to the economic interests of the colonists and sparked discontent.

Furthermore, James II's policies infringed upon the colonists' political and religious freedoms. He sought to establish Catholicism as the dominant religion and limit the power of colonial assemblies, leading to a curtailment of rights and a centralized rule. The colonists valued their self-governance and believed that their own elected representatives should have the authority to make decisions that affected their lives.

In this context, Leisler's Rebellion in New York became a reflection of the broader colonial resentment against James II's policies. Leisler and his followers sought to defend their rights and resist the autocratic rule imposed by the king's governor, Edmund Andros. They seized control of Fort James and attempted to hold New York for William III and Mary II, who were seen as more sympathetic to the colonists' concerns.

So, while James II was removed during the Glorious Revolution, the policies and actions he undertook during his reign were the catalyst for the colonists' resentment, leading to uprisings such as Leisler's Rebellion in New York.